GNOME Bugzilla – Bug 510831
No Scala support in gedit
Last modified: 2009-12-29 14:51:53 UTC
gedit currently does not support syntax highlighting for Scala (http://www.scala-lang.org/). This could be a starting point: <?xml version="1.0" encoding="UTF-8"?> <language id="scala" _name="Scala" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-scala</property> <property name="globs">*.scala</property> <property name="line-comment-start">//</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="string" _name="String" map-to="def:string"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="specials" _name="Specials" map-to="def:specials"/> <style id="data-type" _name="Data Type" map-to="def:data-type"/> <style id="others" _name="Others"/> </styles> <definitions> <context id="block-string" style-ref="string"> <start>"""</start> <end>"""</end> </context> <context id="string" style-ref="string" end-at-line-end="true"> <start>"</start> <end>"</end> </context> <context id="string-2" style-ref="string" end-at-line-end="true"> <start>'</start> <end>'</end> </context> <context id="line-comment" style-ref="comment" end-at-line-end="true"> <start>//</start> </context> <context id="block-comment" style-ref="comment"> <start>\/\*</start> <end>\*\/</end> </context> <context id="declarations" style-ref="keyword"> <keyword>class</keyword> <keyword>def</keyword> <keyword>extends</keyword> <keyword>forSome</keyword> <keyword>implicit</keyword> <keyword>import</keyword> <keyword>mixin</keyword> <keyword>object</keyword> <keyword>package</keyword> <keyword>trait</keyword> <keyword>type</keyword> <keyword>val</keyword> <keyword>var</keyword> <keyword>with</keyword> </context> <context id="primitives" style-ref="data-type"> <keyword>Boolean</keyword> <keyword>Byte</keyword> <keyword>Char</keyword> <keyword>Double</keyword> <keyword>Float</keyword> <keyword>Int</keyword> <keyword>Long</keyword> <keyword>Short</keyword> </context> <context id="flow" style-ref="keyword"> <keyword>case</keyword> <keyword>catch</keyword> <keyword>do</keyword> <keyword>else</keyword> <keyword>finally</keyword> <keyword>for</keyword> <keyword>if</keyword> <keyword>match</keyword> <keyword>requires</keyword> <keyword>return</keyword> <keyword>throw</keyword> <keyword>try</keyword> <keyword>while</keyword> <keyword>yield</keyword> </context> <context id="modifiers" style-ref="keyword"> <keyword>abstract</keyword> <keyword>final</keyword> <keyword>implicit</keyword> <keyword>lazy</keyword> <keyword>override</keyword> <keyword>private</keyword> <keyword>protected</keyword> <keyword>sealed</keyword> </context> <context id="memory" style-ref="others"> <keyword>false</keyword> <keyword>new</keyword> <keyword>null</keyword> <keyword>super</keyword> <keyword>this</keyword> <keyword>true</keyword> </context> <context id="numeric" style-ref="decimal"> <match>(\b([0-9]+|0[xX][0-9a-fA-F]+)[Ll]?\b|\b(([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFdD]?|[0-9]+[FfDd]))</match> </context> <context id="scala"> <include> <context ref="block-string"/> <context ref="string"/> <context ref="string-2"/> <context ref="line-comment"/> <context ref="block-comment"/> <context ref="declarations"/> <context ref="primitives"/> <context ref="flow"/> <context ref="modifiers"/> <context ref="memory"/> <context ref="numeric"/> </include> </context> </definitions> </language>
Is it a lang file you are using, does it work for you?
Yes it is a .lang file and it works fine for me. There is no special highlighting for some advanced Scala features such as inline XML.
Ops this one was off the radar since it is pasted inline instead of beeing an attachment :-) Sorry about that. Submitted files need to have a license... do you still use the file? do you have an updated version? can you add the LGPL 2 blurb and attach it?
No response about license etc, closing for now, feel free to reopen with an updated file.