Sublime Forum

How To Add Symbols (for Goto Symbol)?

#1

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,

0 Likes

#2

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]<?xml version="1.0" encoding="UTF-8"?>

name Symbol List: Method scope source.ruby meta.function settings showInSymbolList 1 uuid 92E190C9-A861-4025-92D4-D6B5A24C22D4 [/code]

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.

0 Likes