Home Download Buy Blog Forum Support

scala syntax highlighting problem

scala syntax highlighting problem

Postby realdope on Tue Nov 13, 2012 8:55 pm

Check out the syntax highlighting on the following valid scala code in sublime version 2.0.1 Build 2217:

Code: Select all
object HelloWorld {
  class Complex(_re:Double, _im:Double) {
    def re = _re
    def im = _im
    override def toString() = "" + re + (if (im<0) "" else "+") + im + "j"
  }
  def main(args: Array[String]) {
    println(new Complex(1.5, 2.3))
  }
}


This is what I see:
Image
realdope
 
Posts: 5
Joined: Mon Jul 09, 2012 12:31 pm

Re: scala syntax highlighting problem

Postby facelessuser on Tue Nov 13, 2012 9:11 pm

In your Scala.tmLanguage file change the following line to what you see:
 619                     <string>&lt;/?([a-zA-Z][a-zA-Z0-9]*)</string>
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: scala syntax highlighting problem

Postby realdope on Wed Nov 14, 2012 5:24 am

Awesome. that fixed it.
realdope
 
Posts: 5
Joined: Mon Jul 09, 2012 12:31 pm

Re: scala syntax highlighting problem

Postby StFS on Tue Feb 25, 2014 5:46 pm

Hi.

I seem to be having the same problem in Sublime Text 3 (build 3059 installed with the Ubuntu .deb package).

I can't locate the Scala.tmLanguage file. All I can find is some file that seems to be compiled at $HOME/.config/sublime-text-3/Cache/Scala/Scala.tmLanguage.cache

The only other thing I find is the global /opt/sublime_text/Packages/Scala.sublime-package file that seems to be a binary file as well.

How can I fix the Scala syntax highlighting file for Sublime Text 3?
StFS
 
Posts: 2
Joined: Tue Feb 25, 2014 5:41 pm

Re: scala syntax highlighting problem

Postby StFS on Tue Feb 25, 2014 6:11 pm

Nevermind. I figured it out.

For future reference the syntax file is in /opt/sublime_text/Packages/Scala.sublime-package which is a zip file.

So you need to copy that file and unzip it, change the Scala.tmLanguage file as per the instructions above and then rezip the whole thing and replace /opt/sublime_text/Packages/Scala.sublime-package with that zip file instead.

It's a bit surprising that this hasn't been fixed in the official version. I'll send in a feature request and point this out.

UPDATE: feedback sent (http://sublimetext.userecho.com/topic/4 ... -included/)
StFS
 
Posts: 2
Joined: Tue Feb 25, 2014 5:41 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 36 guests