Do any of you face this problem where vscode always takes you to the type definition of a function and not the implementation.
For example, I right click on the react setState function as below,
And VS code shows me the typescript file.
How do I look at the implementation and not the type definition of a function?
Do any of you face this problem where vscode always takes you to the type definition of a function and not the implementation.
For example, I right click on the react setState function as below,
And VS code shows me the typescript file.
How do I look at the implementation and not the type definition of a function?
Share Improve this question edited Nov 13, 2024 at 9:09 Ryan Wheale 28.5k10 gold badges86 silver badges102 bronze badges asked Mar 9, 2018 at 16:17 RahulRahul 7322 gold badges9 silver badges26 bronze badges3 Answers
Reset to default 5This is a limitation of VS Code's intellisense. We don't attempt to parse js from inside node_modules
for IntelliSense, so we have no way of mapping back to the original source code. Instead we rely on *.d.ts
to provide definitions.
These two issues are tracking possible improvements to this:
- https://github./Microsoft/TypeScript/issues/6209
- https://github./Microsoft/TypeScript/issues/16792
In vscode v1.67 there is update with new Go to Source Definition mand
Jump directly to a JavaScript implementation of a library function using the new Go to Source Definition mand. You can learn more about this feature and share feedback in TypeScript issue #49003.
HTML project live preview option on clicking in show in browser the whole project showing that window cannot find web view , type name correctly and then try again