Sublime Forum

Using VS Code .tmLanguage.json in Sublime Text

#1

I’ve been trying to get Sublime Text to highlight Scala 3 properly (the standard syntax supports Scala 2, but not Scala 3, which is rather new). Thanks to someone on the Discord server, I downloaded this tmLanguage file that VS Code uses to highlight Scala 3.

After running it through a formatter, I renamed it to Scala3.tmLanguage, changed the “name” to “Scala3” from “Scala,” put it into a zip named “Scala3.zip,” renamed the zip “Scala3.sublime-package,” and put it into C:/Program Files/Sublime Text 3/Packages with all the other languages’ packages. However, when I restarted Sublime Text and tried to set my syntax to that, I couldn’t find it in the menu.

Is there any step I missed/did wrong here? Thanks in advance.

0 Likes

#2
  1. You should place custom packages into %APPDATA%\Sublime Text 3\Packages. The folder you’ve choosen is overwritten if ST is updated and any changes get lost.
  2. It is very likely the source syntax uses more recent TextMate features, which are not supported by Sublime Text. Thus the syntax might fail to be recognized. Not sure though, haven’t double checked sources.
1 Like

#3

Do you mean AppData/Roaming/Sublime Text 3/Packages/User? I’ll go through the syntax and see if it has anything new, thanks.

0 Likes

#4

If it’s just a single .tmLanguage file, I’d recommend just putting that file in the User directory (Instead of doing all that zip files and such)

0 Likes

#5

I’d tried that before, but the syntax didn’t show up when I searched “Set Syntax.”

0 Likes