Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

422
Visualizações
VSCODE Jump to the JS file definition (not the .d.ts file)

I'm sure thousands of other JS devs are feeling the pain I'm feeling. I love jumping to function definitions in .d.ts files while browsing code in VS Code.

However, sometimes instead of going to the .d.ts file, I'd like to jump to the raw JS code that is being hidden by the .d.ts file that sits in front of it.

Does anyone know how to optionally force a jump to the JS source code (if it exists) and not a TypeScript definition file.

Thanks!

EDIT: I am aware that this has been asked for to the VS Code team and will not be officially supported by them. I'm looking for some sort of hacky workaround (extension or otherwise) to get this to work.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Recently announced, VS Code Insiders (v1.67.2) supports a Go to Source Definition context menu option from right-clicking the symbol. This was committed 19-APR-2022.

It's not exactly a click-to-source, but it's a step in that direction.

screencast

Go To Source Definition requires TypeScript 4.7.

about 4 years ago · Juan Pablo Isaza Relatório

0

Delete the .d.ts file (temporarily)

This is obviously a super-crappy workaround, but it should work. By deleting the file you don't want to see, VSC will only have one place to take you: the file you do want to see.

  1. When VSC takes you to the .d.ts file, right-click on the file tab and click "Copy Relative Path"
  2. Open the VSC terminal and enter rm [PATH] (or del [PATH] for Windows)
    • leave the (now-deleted) .d.ts file tab open
  3. Go back to the original file and try navigation again
    • if it doesn't work, you may need to reboot the TS server
  4. Once you've seen the code you want to see, go back to the .d.ts file and save it
    • this will put the file back exactly as it was, which will probably be invisible to your source-control
    • if not, you may need to use your SCM to undo the deletion operation

Again, an awful hack. And I share your frustration that the VSC maintainers & community have no interest in this feature. Just bear in mind that their goal is to make their propriety technology displace all technology they don't own, so you will occasionally discover that they will refuse to help you as a web developer because they want you to be a Microsoft developer.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda