Sublime Forum

Symbols list not indenting anymore

#1

My symbol list used to indent class methods in CoffeeScript but now there is no indentation and other things are showing up (like console, new Object, etc). I was thinking this was a CoffeeScript tmLanguage issue, but JavaScript files are also showing things I don’t need to see (console, Object, etc). Ruby files are also flat. Anyone know how I could fix this? It’s fairly annoying to have a “dirty” symbols list now. Also, it used to be so nice to see indented class methods.

I have two Macs one is running ST2 build 2217 and the other is 2218. I also have a PC running 2181, and I just now upgraded to 2217. I’m not exactly what happened to change things. I did just install Mountain Lion on my Macs, but that wouldn’t affect my PC. It’s especially strange that my PC install is flat, since it doesn’t share anything with my Mac setup and I tested it using the old build 2181. I’ve tested with existing code and new code.

The closet I got to fixing things was editing the CoffeeScript.tmLanguage and removing references to console and Object, but then I can’t get those keywords to highlight in ST2 (understandably). More importantly, though, I have not found a way to fix the symbol list so that it indents.

Also, on a separate but somewhat related note, anyone know if there is a plugin that would let me see the symbol list but never hide it. Like a floating panel or something?

Thanks for any help!

0 Likes

#2

(Disclaimer: I don’t know anything about CoffeeScript.)

The symbol list is compiled using the definitions from the various .tmPreference files provided by syntaxes and plugins. These files basically take specific scopes (like the ones you removed from the .tmLanguage file), optionally transform them with regular expressions, and then pass them on to the Symbol List. My guess is that one or more packages have some dodgy .tmPreference definitions, which are messing up your symbol list.

Because the extension .tmPreferences is also used for things other than symbol lists, the convention is for files that pass information to the symbol list to be called “Symbol List [Whatever].tmPreferences” so start by looking for “Symbol*tmPreferences” in your Packages folder and then disabling these packages (via the Package Control) until you find the culprit. Note that, if the package is really dodgy, the file in question might well be called “Something.tmPreferences” without reference to the Symbol List. But that’s another story…

I’ve ran into similar issues and they can be quite annoying to troubleshoot. It’s also quite late here, so let me know if the above doesn’t make any sense :smile:

Hope this helps,
Alex

0 Likes

#3

Yay, I got it working!
Thanks Alex, your comment about the Symbol List helped me to realize that the package I installed from the package manager didn’t contain the proper files.

For anyone having the same problem, here’s how to fix it (assuming the plugin author doesn’t fix the issue soon - I’ve messaged him about the problem):

  1. Install the CoffeeScript plugin, like usual (through the package manager), then go to github.com/jashkenas/coffee-scr … references and download all these files into your “~/Library/Application Support/Sublime Text 2/Packages/CoffeeScript” folder. That should do it (might need to restart ST2).

  2. Go to github.com/jashkenas/coffee-script-tmbundle, follow the instructions in the readme. But, then copy the content of the subdirectories into base (CoffeeScript) folder (in other words, ST2 doesn’t drill down into some of the subdirectories to get at the appropriate files). Technically, I think you only need to copy the “Preferences” and “Syntaxes” subdirectories into the CoffeeScript base folder. Anyway, option 1 is probably easiest.

0 Likes