Sublime Forum

Can I filter items from the Goto Symbol panel?

#1

I use the Goto Symbol panel often, but I’d love to be able to filter out certain items from the result set (particularly lambda functions in Python). Is there an easy way to do that?

0 Likes

Filter Goto Symbol list at runtime
#2

Python lambda functions don’t appear in Goto Symbol by default as far as I can see (on Build 3118) - are you using a non-standard Python syntax definition? or maybe you have overridden the Symbol List.tmPreferences file in the Python package or something?

0 Likes

#3

The only package that has a Symbol List.tmPreferences file in my install is PlainTasks, and it doesn’t appear to be Python specific. How would I know if I’m using a non-standard Python syntax definition?

I should probably mention that I’m on build 3114.

0 Likes

#4

Ah yeah, I can see that 3114 indexes lambda functions. To change this functionality:

  1. Install PackageResourceViewer from Package Control, if it isn’t installed already
  2. Open the Command Palette
  3. Type PRV: O and select PackageResourceViewer: Open Resource
  4. Navigate to Python
  5. Symbol List.tmPreferences
  6. Change <string>source.python meta.function - meta.function.decorator, source.python meta.class</string> to <string>source.python meta.function - meta.function.decorator - meta.function.inline, source.python meta.class</string>
  7. Save the file

and lambda functions will no longer show in Goto Symbol :slight_smile:

Note: when you upgrade to a newer version of ST3, I recommend deleting the override file you just created, so that you will use the official version of the file, which will contain this change. To do this:

  1. Tools -> Browse Packages
  2. Python folder
  3. Delete Symbol List.tmPreferences
0 Likes

#5

You mention that the official package will contain this change going forward. Are you filing a bug against the package repo for that, or should I?

0 Likes

#6

There is no need to file a bug report - it is already fixed and available in build 3118: https://github.com/sublimehq/Packages/commit/d180a788d77ba418d5b8a91fb49a53bfce73ee02

1 Like