Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go to definition and back to reference in visual Studio Code

I'm currently using VSCode and am trying to use the F12 shortcut which takes me to a definition of an object/function. When I want to go back to the reference, I can't seem to find the right way to do it. With VS community I used Shift + F12.

I've try different combinations, such as Alt + F12 or Shift + F12 but all I get is a peek definition of the element which is not useful at all; it's just a popup showing the same element in the same file I'm at. I've seen answers to this question but pertaining to VS 2010 which are no longer applicable or doesn't work with VSCode.

Question: What is the shortcut to Go Back once you've used F12 to Go to the definition?

like image 345
Pablo Avatar asked Feb 27 '17 18:02

Pablo


People also ask

How do you jump to define in VS Code?

Go to Definition# If a language supports it, you can go to the definition of a symbol by pressing F12. Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

How do I go back to define in Visual Studio?

For those using newer versions of Visual Studio Code: the shortcut is Alt + ← . Alternatively, click Go --> Back .


1 Answers

For macOS it is ⌃- (Ctrl + -) by default. And for Windows: (Alt + LeftArrow)

like image 151
Konstantin Nikitin Avatar answered Sep 19 '22 03:09

Konstantin Nikitin