Search code examples
visual-studio-codeideshortcutfunctional-interface

VSCODE. How to open a file containing a variable or html tag by clicking it?


I'm not sure how to describe the question properly. I used to use IDE tools such as IntelliJIdea. One of the useful functions from intelliJ was to open an external file by clicking an imported variable or component. I wonder if there is such functionality in vscode too. Although I tried looking up in the document, I couldn't find information about it. Does vscode really not have that convenient functionality?


Solution

  • Visual Studio Code does provide this feature.

    If you hold down the Ctrl key in VSCode and for example hover over a function call, a small info box appears (like shown below).

    enter image description here

    If you now click on it (while still holding down Ctrl), VSCode automatically opens the corresponding file in a new tab and jumps to the line where the function was defined.

    enter image description here

    This works for variables, instances of classes etc. as well.