Comments (4)
That is how jump-to-def always works for local variables -- it takes you to the variable's definition. In this case, the parameter. I guess there's a case to be made for having a mode where it tries to go to the definition of the type of the variable, but that doesn't always apply (and as far as most of Tern is concerned, the arguments to a define
or requirejs
call body are normal parameters).
from tern_for_sublime.
That makes sense. Just realised that jump-to-def will work if your AMD module is an object with properties defined on it. When you jump to those, then it will take you to the AMD definition.
I half expected it to take me to the AMD definition when using jump-to-def on the function parameter, but I understand why it doesn't. Is there any other way this could be achieved?
Thanks for your amazing work.
from tern_for_sublime.
If you remove the if (!span)
part on line 691 in lib/tern.js
, it'll behave the way you want in this situation—but it'll behave badly in other situations, so I don't want to simply make that change. You could add an option to the definition
request that puts it into this mode (prefer the type's location over the variable's location), and add a binding in the sublime plugin that looks for a definition using this mode.
from tern_for_sublime.
I don't think I'm going to add this feature seeing as I now realise how it's supposed to work, but thanks for explaining. :-)
from tern_for_sublime.
Related Issues (20)
- command/keybinding to only select the next occurence HOT 1
- Inconsistent tooltip sizes
- Trigger module name autocomplete HOT 1
- ST3 NameError global name 'view' is not defined HOT 2
- Styling of tooltips HOT 2
- Package import autocompletion causes duplicate quotes HOT 8
- Enabling doc_comment breaks completions for class methods
- Autocomplete not working HOT 2
- Sublime locks up on any file edits HOT 1
- Completion performance on mac os 10.13 because localhost and 127.0.0.1
- ; error HOT 3
- new plugin for Javascript support - JavaScript Enhancements
- `tern_jump_to_def` command doesn't work for es6 classes created locally
- Turn off the triggers after ";" HOT 2
- [Error] error: plugin_host has exited unexpectedly HOT 1
- TypeError: Cannot read property 'start' of undefined HOT 2
- Tab Completion for File Names
- Tern.JS for Sublime Text has slowed to a halt in the past week or so. HOT 1
- failed to load the tern apckage
- Wrong or no functionality in sublime-text 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tern_for_sublime.