Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2019: Peek definition with combination of mouse and keyboard click

By default, Peek Definition is performed if you click Alt+F12 in VS 2019. If you use mouse click + Ctrl then Go to Definition is performed.
Is there also an option to use the combination of mouse click and a keystroke to perform Peek Definition?

like image 383
Code Pope Avatar asked May 07 '19 14:05

Code Pope


People also ask

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

Ctrl-click Go To Definition 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 peek in Visual Studio?

You can peek a definition by choosing Peek Definition from the right-click menu for a type or member that you want to explore. If the option is enabled, you can also peek a definition using the mouse, by pressing Ctrl (or another modifier) and clicking the member name.

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.


1 Answers

You need to set an option first (documented below).

So...CTRL+Click will go to the definition. You can make it open a Peek window by changing an option.

Click Tools->Options
Under Text Editor->General
Enable mouse click to perform Go to Definition (should be checked)
Check the Open definition in peek view

Now Ctrl+Click will open a peek window.

You could also just right click on it and Peek Definition.

like image 56
Chris Catignani Avatar answered Nov 03 '22 01:11

Chris Catignani