Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go to definition in new tab without changing the view

Tags:

When I do command + click on visual studio or right click and "go to definition", the file containing the definition opens in a new tab and I automatically see this file. So I change the view if the file containing the definition is another file.

Is it possible when I do this command to stay on the same file I was while still opening the other file in another tab?

Thank you for you answer.

like image 301
Martin J Avatar asked Jun 15 '18 16:06

Martin J


People also ask

How I can make Ctrl click to go to definition in Visual Studio?

Ctrl-click Go To Definition Symbols become clickable when you press Ctrl and hover over the type or member. To quickly navigate to the definition of a symbol, press the Ctrl key and then click on it. It's that easy!

How do I enable definition in Visual Studio?

Visual Studio Go To Definition The Go To Definition feature navigates to the source of a type or member and opens the result in a new tab. Using Keyboard, place your cursor on the member name and press F12. Using the mouse, right-click on the member name and select Go To Definition from the menu.

What is the code to open a new tab in Visual Studio?

To open a new tab in VS Code, all you need to do is double-click it instead of single-clicking it. This may seem a bit weird and confusing, but once you've gotten used to this function, you'll realize that it actually makes your job much easier.


2 Answers

Preferences >> Settings >> Workbench >> Editor >> Enable Preview >> Uncheck/false

like image 157
sagarpatidar Avatar answered Sep 22 '22 07:09

sagarpatidar


If you're capable to actually go to the definition you are looking for what is called the "Peek Definition". VS Code is highly customizable so how you have it configured it could do something different.

What I think you're looking for is Ctrl + Left Mouse Click or Alt + F12.

This should tell you more, VS Code Peek Definition

like image 24
Dylan Wright Avatar answered Sep 20 '22 07:09

Dylan Wright