microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Fix issue #604 - GoTo Definition shows all function calling in file #653

Closed binarynate closed 5 years ago

binarynate commented 6 years ago

This is a fix for issue #604 .

I added a 'Symbol List.tmPreferences' file to fix the issue where if you try to go to a function definition, it takes you to the first instance of where the function is used (not necessarily its definition).

I have been using this fix locally for a few weeks now, but this file was removed when I updated my TypeScript plugin.

DanielRosenwasser commented 6 years ago

Hey, thanks for the PR! Can you explain where this is documented, and which declarations this is intended to cover? For example, I don't think decorators should be considered definition sites.

stweedie commented 6 years ago

Symbols (From sublime's documentation).

The expressions list is pulled from TypeScript.tmLanguage. the 'showInSymbolList' set to 0 means that the above expressions DO NOT appear in the symbols list. In this case, syntax equates to: don't show decorators, local variable declarations, blocks, or member variables.

The main goal is to remove some things from the symbols list. Right now, everything is shown, including local variable expressions and ALL function calls (not just the function definitions). Whichever meta elements in the .tmLanguage file you would like to ignore, place them in that list.

note that the issue referenced is 'closed' because the author received a temporary workaround and then closed that issue. In fact, every update of this plugin reverts that workaround.

binarynate commented 5 years ago

Closing this, since I switched to VS Code