Traditionally when you want to view the definition of a method you place your cursor inside the call:
Then press F12 to go to the document where the definition exists:
But what if you don’t want to leave your current location:
No problem! Just take advantage of the new Peek Definition feature by pressing ALT+F12:
This feature will actually open a small window below the method call so you can view its definition. This makes it very easy to view a definition without losing your place in the current document.
If I want to go to another definition from here I can just place my cursor inside the item:
And press ALT+F12 again. It will update the window to show the new definition:
But something else also happens. Notice the dots showing up in the top right-hand side of the window:
The Peek window is keeping track of the definitions you have been to so you can navigate easily between them:
You can use your mouse to click any of the dots or the forward and back links. Also, as you can see, you can use CTRL+ALT+Minus(-) and CTRL+ALT+Plus(+) to move backward and forward respectively.
I’m not sure what the upper limit is on number of entries it will remember but at 18 entries the More indicators showed up to allow navigating through a higher number of definitions. I suspect the number of entries can go quite high:
The next most obvious question is: “Can I edit the code in this definition window?” Currently the answer is “no” however it is something that is being considered before we ship. Let me know your thoughts.