javascriptvisual-studio-codevscode-debugger

VSCode always shows type definition and not the actual implementation


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, enter image description here

And VS code shows me the typescript file. enter image description here

How do I look at the implementation and not the type definition of a function?


Solution

  • This 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: