jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

In shell script I cannot goto certain function definitions #178

Closed zkutasi closed 6 years ago

zkutasi commented 8 years ago

I have found, that in Sublime-Text 3 Build 3103, I cannot "goto" to certain function definitions, like:

function unlockAmfSu { ... }

If I put it like this:

function unlockAmfSu() { ... }

Everything is OK.

I have found the problem is in the syntax file of Shell-Scripting, namely the word "function" is caught by context "pipeline". This causes that the indexer is not picking up these functions as definitions, so the "goto" does not work.

I have found two solution: remove "function" from pipeline, OR reorder the includes at the beginning of file Shell-Unix-Generic.sublime-syntax, to include function-definition earlier.

FichteFoll commented 6 years ago

@rwols looking at this briefly, the first example does end up being scoped as entity.name.function, but the trailing newline is also scoped. Maybe you want to take care of this?

2017-11-08_17-31-34