Goto definition vs code goes to node_modules/@types instead of my .ts file

Viewed 230

Usually when I want to navigate to the definition in vs code I get an annoying popup that gives me to select between .d.ts file and my file enter image description here

I wanted to remove that and make it navigate to my file always. I changed this enter image description here , but now it always goes to the .d.ts file. How can I make it go to my component declaration instead?

1 Answers

Unfortunately it will always go to the primary source. From my research there is not a way to choose what the primary source is. Below is the settings.json for this.

  //  - peek: Show peek view of the results (default)
  //  - gotoAndPeek: Go to the primary result and show a peek view
  //  - goto: Go to the primary result and enable peek-less navigation to others
  "editor.gotoLocation.multipleDefinitions": "peek",

You can still navigate quickly by using the f12 key to switch locations

Related