Home Download Buy Blog Forum Support

How To Add Symbols (for Goto Symbol)?

How To Add Symbols (for Goto Symbol)?

Postby protoplasm on Thu Dec 17, 2009 1:40 pm

Hi there,

When editing a Ruby (*.rb) file, Goto Symbol (CTRL+R) says "No Symbols" yet, in my JavaScript files, the same thing results in a quick panel containing all the functions in the current file.

I guess I'm wondering if it's a bug/not yet implemented feature that Ruby shows nothing, or if I am expected to build a list/write a snippet to do it? FWIW, my Ruby file contains just one class, consisting of a few procedures.

Thanks,
protoplasm
 
Posts: 23
Joined: Tue Oct 20, 2009 4:47 pm

Re: How To Add Symbols (for Goto Symbol)?

Postby protoplasm on Fri Jan 29, 2010 8:14 am

So, I eventually got around to looking into it further and I suspect this isn't news to most people, but maybe it'll help someone trying to find similar answers:

It seems you need one (or more) of the Symbol List tmPreferences files for the language you're using, as well as the various other files like tmLanguage, but my Ruby package was only missing the former. I had a very quick hunt and found a file which I tweaked slightly (it stripped the def prefix in the symbols list and I've left that in just because the JavaScript one leaves function). Then I saved the file as Symbol List Function.tmPreferences, in my Packages\Ruby folder under my Sublime profile.

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>name</key>
   <string>Symbol List: Method</string>
   <key>scope</key>
   <string>source.ruby meta.function</string>
   <key>settings</key>
   <dict>
      <key>showInSymbolList</key>
      <integer>1</integer>
   </dict>
   <key>uuid</key>
   <string>92E190C9-A861-4025-92D4-D6B5A24C22D4</string>
</dict>
</plist>


I kinda fumbled my way through, but hopefully jps will add a better, or more complete set, of Ruby Symbol List tmPreferences file to an upcoming build.
protoplasm
 
Posts: 23
Joined: Tue Oct 20, 2009 4:47 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 11 guests