9

For example I command click on the express() function to jump to it's definition:

const app = express();

vscode then jumps to this line inside an index.d.ts file:

declare function e(): core.Express;

Doing a Jump to Definition / command-click on the e() function just puts me back in the same file. But I would like to see the actual javascript code that underlies the types wrapper without having to search for it somewhere in node_modules.

How do you do that?

Mahyar
  • 171
  • 1
  • 4
  • 1
    Does this answer your question? [Go to the TypeScript source file instead of the type definition file in VS Code](https://stackoverflow.com/questions/48711065/go-to-the-typescript-source-file-instead-of-the-type-definition-file-in-vs-code) – Alexey Romanov May 06 '22 at 12:40

1 Answers1

0

As of VS Code 1.24, his is not possible in general for third party node modules. VS Code uses those *.d.ts file to provide good intellisense without having to process the original implementation files. You can find more information about this here

Using typings files is more reliable and performant, but it also means that we cannot jump back to the original JS implementation.

Matt Bierner
  • 58,117
  • 21
  • 175
  • 206