-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Go to definition for nodejs javascript file broken by existance of .d.ts
#38474
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
Comments
I am confused why this is a TypeScript issue and not a VS code issue ? I am trying to use Is the JavaScript language server and/or go to definition implemented in TypeScript itself ? Would a syntax highlighting bug in JavaScript in vs code also be a "microsoft/TypeScript" issue ? Cc @mjbvz |
The TypeScript language service powers VS Code's JavaScript and TypeScript IntelliSense Syntax highlighting comes from https://github.com/Microsoft/TypeScript-TmLanguage |
I agree with the suggestion that it would improve the user experience if VSCode had an option to prefer JS sources over *.d.ts files or otherwise allow users to never see a *.d.ts file when going to the definition of a JS function. |
I’ve run into this issue again today. I would like an option to ignore *.d.ts files always go to the definition of the real javascript source code. |
I'm trying to get Intellisense to work for a javascript project and I'm also running into this issue. Finally got intellisense working but now go to definition ends in the .d.ts files. |
Is there any progress on this? |
Steps to Reproduce:
require
statement.d.ts
file.Does this issue occur when all extensions are disabled?: Yes
Example go to definition that works
Example of go to definition thats broken
Example of go to definition can be made to work for
is-promise
The
is-promise
javascript library has anindex.d.ts
file which breaks go to definition because it exists.I can remove this file by running
rm node_modules/is-promise/index.d.ts
It's really frustrating that
go to definition
only works if theindex.d.ts
does not exist.One work around would be to
rm ./node_modules/**/*.d.ts
Possible duplicate
microsoft/vscode#82054
This issue is very similar to the above.
It was closed because
This is not correct, i manually deleted the
index.d.ts
file fromnode_modules/is-promise
and got exactly the behavior that i wanted.The vscode go to definition for nodejs javascript works in almost all cases except when a
.d.ts
file exists.It would be great if vs code has a flag to ignore
*.d.ts
files for when going to definition in a javascript project.The text was updated successfully, but these errors were encountered: