Answer the question
In order to leave comments, you need to log in
Is it possible in VS Code to make Go To Defenition work for JS with ambiguous definitions?
Faced strange behavior of the Go To Defenition function in VS Code.
Having a function call, I want to jump to its definition. In WebStorm, this is done using the Ctrl + Click combination on the function name. In VS Code, I use the F12 key for this, however, for most function calls I get "No definition found".
Example 1:
When trying to navigate to the definition of foo on line 7, I expect the cursor to move to line 5, but I get a "No definition found" error.
var helper = {
SOME_CONST: 2
};
helper.foo = function() {} //<= сюда
helper.bar = function() {
this.foo(); //=> отсюда
}
var FooBarClass = function () {
};
FooBarClass.prototype.doJob = function() {
var arr = [0, 1, 2];
arr.map(function() {
this._helper(); //=> отсюда
}, this);
}
FooBarClass.prototype._helper = function() { //<= сюда
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question