-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
findDef (find definition) doesn't always work #67
Comments
Definition locations are currently only tracked for variables and function/object types. I could store locations in property definitions, but I'm not sure how useful that would be. Thoughts? |
Thanks. That was what I was seeing during debugging, but wasn't sure why. Our testers thought it was a natural thing to try. |
That would explain another scenario I believe this impacts - module exports... in the code below, usages of this module cannot jump to the exported title var definition because it is assigned a String. If you assign it an Object, jump to definition works.
|
And track them for all properties. Issue #67
See commit aa3bcb8 , which cleans up the way properties and variables have their definition tracked, and fixes this issue in the process. |
Using the following code to test findDef (called jump-to-definition on the tern.js demo page):
var base = {foo: 10, foo2: { bb : "test" }};
base.foo2.bb = "hello";
base.foo = 10;
If I place the cursor on foo2 on the second line, jump-to-definition works. But if I put the cursor on foo on the third line (or bb on the second line) it does not. I have traced the code into infer.expressionType() but haven't figured out a solution myself.
The text was updated successfully, but these errors were encountered: