View Code Definition with in Same Code Window – Peek Definition in Visual Studio 2013 Preview

Visual Studio 2013 Preview IDE helps us to view the code definition with in the same code window without navigating to other files.  This feature is known as “Peek Definition”.  “Peek Definition” improves the overall developer productivity and getting things in a smart manner.  The fundamental of this features is very similar to how the traditional "Go To Definition” works. The only difference you will find is, it will display the code in the same window as an extended editor. 

Click on “Peek Definition” form the context menu or use shortcut key “Alt+F12” to leverage this features .

image

Fig: select “Peek Definition” from context menu  to see the members definitions of “Student” class.

This will open a small extended windows with the definition of the selected members as shown in the following.

image

 Fig:  Definition of “Student” class showing in peek definition window.

Similarly you can use the “peek definition” option from the previously open window itself.

image image

 Fig:  Peek Definition for “Address”.

You must be wondering how do you then navigate between the code definition? Visual Studio handles this by providing a navigation pane to move around the opened definition. image

 Fig:  Navigation with in Peek Code Window.

You can also you the “promote the document” ( Which was introduced with VS 2011 Dev. Preview) feature to promote any open peek code windows to a main window.

image image

 Fig:  Promote ‘Code peek window’ as main window

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 Comments to “View Code Definition with in Same Code Window – Peek Definition in Visual Studio 2013 Preview”

Comments are closed.