Sublime Forum

Goto Symbol for Javascript customize

#1

Greetings,

When using Goto symbol Ctrl + R (@) for javascript, it will include anonymous function and MyClass within statement “new MyClass()” to create object. They are not useful at all because they are usually within functions (as per best practices), what we need are the non-anonymous function declarations

So, you will see lots of entries below in the list
function ()
MyClass1
function ()
MyClass2

as per attached screen shot

This makes the list very messy because they are very common Javascript statements, it will make the list extremely powerful if those can be cleanup, because it will be a great navigation tool for function declaration.

Is there any possibilities to filter those statements off the list, would appreciate some help here, any files I can look into or any plugins that can help on this please let me know.

BTW, just bought this great editor today, this is the best editor I ever used :smiley:
Hopefully, I can solve this to make this my perfect editor

Many thanks & Kind Regards
Andy


0 Likes

#2

Any updates on this issue?

I would really like to use the “Goto symbol” @: (Ctrl+R) function to jump between various parts of the code.
Any extension that may do this available?

0 Likes

#3

Coincidentally, I was just suffering from this problem yesterday, and wrote a fix for it.

I’ve published my fix on GitHub, along with instructions for installing it.

Unfortunately, due to the nature of the fixes (they need to override some files in the built-in JavaScript package, and so the package needs to be named “JavaScript” exactly) I don’t know of an easy way to publish it on Package Control. Installing by hand is easy: just ‘git clone’ the repo into a directory named “JavaScript” in your Packages directory.

0 Likes

#4

Works like a charm :stuck_out_tongue:

I wonder if it could be possible to treat some directives in a comment as a symbol.
That would be useful in long scripts/functions, so that the text that will follow a special directive would show up in @Symbols list
The directive could be something like <—> or {{}} or <…> or //// or anything.
E.g.

////// Label for SublimeText Symbols list item

Perhaps the directive should be optional with optional custom directive string

Thanks

0 Likes