F12 finds all references, not go to definition

后端 未结 5 1227
傲寒
傲寒 2021-01-22 09:54

Lately my F12 key does not seem to be working as expected in Visual Studio 2010 Professional SP1. It should go to the definition of what is selected, but instead it\'s performin

相关标签:
5条回答
  • 2021-01-22 10:33

    You can set any keyboard shortcut to any command. Type edit.gotodefinition to select the command and press F12 to assign the key.

    like this enter image description here

    0 讨论(0)
  • 2021-01-22 10:46

    Delete your SUO file before opening your project in Visual Studio. Unfortunately you have to do this every time before opening your project. This will also work when Visual Studio stopped regenerating the designer files.

    0 讨论(0)
  • 2021-01-22 10:47

    I had the same issue where my F12 key was not working nor were any of my other Function keys. After spending some frustrating time Googling I found that my fancy keyboard had the function key locked! So check that too before try the Tools-> Options

    0 讨论(0)
  • 2021-01-22 10:51

    I experienced this exact misbehavior today with VC++ 2013: pressing F12 was no longer jumping to a method's definition, but was instead showing a list of references to that method.

    Turns out IntelliSense is required in order for the command Edit.GoToDefinition to work, which I had disabled this morning. Setting Tools>Options>Text editor>C/C++>Advanced>IntelliSense> Disable IntelliSense back to False fixed the problem.

    0 讨论(0)
  • 2021-01-22 10:52

    Maybe there is more than one definition for the class or function in your project?

    I had this problem after copy/pasting a class definition. After pressing F12 on the class name, it first brought up a search result showing both files in which the class name was found. If you press F12 another time, it will jump to the first one in the search results.

    Did you know that you can use Ctrl + - (Minus) to jump back? :-)

    0 讨论(0)
提交回复
热议问题