Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio “Go to definition” disabled or gray out

Visual Studio's Go To Definition is disabled and F12 doesn't work. Other commands like Alt-F12 may continue working.

like image 569
Jonathan Allen Avatar asked Sep 17 '14 19:09

Jonathan Allen


People also ask

Why is definition disabled in Visual Studio?

Answers. Don't close Visual Studio but close all the files and open them again by clicking on the file in the solution. The file might have been opened by Source Safe or you maybe opened it from Windows Explorer. In this case the file doesn't get assosiated with your solution and the Go to Def.

How to enable Go to definition in Visual Studio 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.

Why is my IntelliSense not working?

If IntelliSense is not working as it should on your Windows 11/10 PC, you can try restarting VS Code and this should solve the issue. Restarting the program can be really effective and time saving in some cases. If the issue persists, you can try restarting your computer altogether.

How do I enable peek in Visual Studio?

Open a Peek Definition window 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.


2 Answers

  1. Close the solution.
  2. Delete the intellisense database file for the solution: [solution].ncb or [solution].suo
  3. Reopen the solution.
  4. Optional: Rebuild the solution.
like image 128
Jonathan Allen Avatar answered Sep 25 '22 03:09

Jonathan Allen


Note that this can also be as a result of disabling database for C++/C#.

In Tools - Options, type "IntelliSense" into the search box, and click on C/C++ - Advanced. In the Browsing/Navigation section, change Disable Database to False, if it is not so already.

Tools - Options

After re-enabling, close and reopen to force rebuild. NOTE: IntelliSense will produce large files on disk (*.sdf and ipch) that should be excluded from Git, for example.

like image 23
ingconti Avatar answered Sep 22 '22 03:09

ingconti