-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
cmd+click skip typescript definition and go to source? #68782
Comments
(Experimental duplicate detection) |
See https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition for why we do this In general, you cannot jump to the js implementation of a npm module |
I'm sorry. What are you expecting me to learn at that link? I don't care about the typings. I want to see the source code when I try to view the definition. |
It's not that TypeScript types are blocking you from jumping to the implementation, it's that there in general is not logic to examine the code of an arbitrary node module and figure out which external invocations map to which implementations in the module. |
I fail to understand that. If I have: const foo = require('foo')
console.log(
foo.bar()
) I can cmd+click on |
I was just about to report this as a bug as well. I'm unsure why we can CMD + click on code in JS files and it points us to the entity's assignment/definition within a file in the The extra problem that I have is when using external packages that don't have TS definitions. To get around the TS errors, I'd put in a |
As others have pointed: This is exactly what is happening though. Jumping to the implementation does work perfectly fine in vscode. Until type definition files enter the picture. Then the only thing that's possible is manually browsing the files and trying to find the implementation the old fashioned way because the type definition file intercepts any attempt to jump to definition using editor commands. |
When I cmd+click on an entity it is supposed to go to the definition of that entity. When said entity is an npm installed module it will go to the source code of that module within
node_modules
iff the module does not have TypeScript definitions. I cannot read TS definitions and would really rather just go to the source code for the entity I need to learn about. How do I make it so that TS definitions are ignored and I am always taken to the source?The text was updated successfully, but these errors were encountered: