You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue occurs in VS Code. The following issues under Typescript are similar, but concerns Javascript instead: #29292 #29232 #26666 #18171
AFAIK, the typescript server for definitions is the same for Javascript. Nonetheless, I'm ok with closing this issue and opening it in the correct project if it does not belong here.
The TS/JS inference engine doesn't assume that this in an object literal refers to the surrounding object - this isn't at all guaranteed and will vary by how the function is called.
Can we have it as an option? Or maybe can we assume that this is refering to the object itself, if nothing else is found?
WebStorm (for example) identifies this case pretty well.
VSCode version: 1.30.2
OS: Mac OS 10.13.6
Search terms: Go to definition, object functions, function arguments
Steps to reproduce:
With the following code, right click on this.funcA() and choose "Go to definition".
Code:
Expected behavior:
Editor jumps to funcA definition.
Actual result:
Editor does nothing.
The same example works fine if the object is outside the function call:
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: