Go To Definition

Free

Make ctrl+click perform a "Go To Definition" on the identifier under the cursor. Also, when the ctrl key is held down, highlight identifiers that look like they have definitions to navigate to.

(61) Review
Visual Studio
2013, 2012, 2010
Download (121,092)
11/10/2013
2.5
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (61)
Q and A (29)
Sign in to write a review
Sort by:

by hsinwei | July 05 2014

by Prateek Bhushan | May 05 2014

It is an awesome tool, however I have to degrade to VS2008, can I use it for that?

Noah Richards May 19 2014
| Edit |
Delete

Nope. VS2008 used a completely different editor and extensibility system, so this definitely won't work there. Sorry :(

by stabilopro | April 19 2014

by Jamie Collins | February 28 2014

A fantastic extension I've been using since VSS 2010 and have just installed VSS 2013.

In common with @a5Digital, I too would like a way of navigating 'Peek Definition' but wonder whether this functionality is exposed by the API. There is no mention of 'peek' in the docs for VSConstants.VSStd97CmdID (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vsconstants.vsstd97cmdid.aspx). So it doesn't seem possible - or am I missing something?

Noah Richards March 01 2014
| Edit |
Delete

It wouldn't be in the "97" set, since that was for VS 97, so waaaay too old :) Check the values in the vsstd12cmdid section, which has peek definition + peek navigate (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vsconstants.vsstd12cmdid.aspx).

by VolarVideo | February 25 2014

I wish this worked. Using VS2013 and GTD 2.5. I ctrl+click doesn't do anything. Ctrl+hover and the identifier turns into a hyperlink but when I click nothing happens.

Noah Richards February 25 2014
| Edit |
Delete

That's unfortunate. Can you point me (a comment in Q&A) at what GTD 2.5 is? It must somehow conflict with how the mouse event is handled, but I'm not sure how.

by Oleg V. Korzhukov | February 18 2014

Most useful extension I ever installed to VS

by Batu Ozk | January 15 2014

by iphilsy | January 03 2014

Thank you thank you thank you. Works great. You turned my frown upside-down!

by ITSTH | November 28 2013

For me it's the best plugin ever for visual studio. It's the fastest way of navigating. Just one suggestion: I think it would be nice if Ctrl+RightClick on a keyword triggered the search for references of a function.

by denis_stankovski | November 21 2013

Thank you so much!

by a5Digital | November 13 2013

I agree with most of these reviews - this extension is a must. However I there is so much more potential here which would leave me baffled if the author doesn't explore the possibility of augmenting this:

a) allow for another key combo + left click perform a peek definition
b) allow for another key combo + left click perform a find all references

If these are exposed via the API (and I believe they are), adding these features should be fairly trivial.

Noah Richards November 14 2013
| Edit |
Delete

Sending a different command would be pretty easy to add, yup. If you want it to be configurable, that's more difficult, but just hardcoding combinations wouldn't be bad.

If you're curious about implementing it yourself, the source is here: https://github.com/noahric/gotodef. The actual command logic is in DispatchGoToDef in GoToDefMouseHandler.cs, so you could probably modify that function (or add new functions) for peek or find all references. Since the extension is still built to be compatible with VS2010, you'd want to hardcode the cmdset/cmdid for peek definition and do a version check first, though.

If you have any questions, let me know on the Q&A!

by Daniel Joos | October 21 2013

Works with VS 2013. It just requires some manual work:
1. Download the .vsix file
2. Unzip it (e.g. using 7zip)
3. Open the vsixmanifest file and add the following block to line 22
<VisualStudio Version="12.0">
<Edition>Pro</Edition>
</VisualStudio>
4. Save and Zip all files again
5. Rename the .zip to .vsix and install it

Noah Richards November 10 2013
| Edit |
Delete

2.5 should now support VS2013. Let me know if you run into any issues, thanks!

by maxima | October 21 2013

+1 VS2013
--------------------------
I use this from day one and is most helpful tool ever... But I have a request (I am amazed that nobody made it yet).

Could you please add Ctrl-Shift-Click to invoke VS Find All References command.

That will make your tool best for ever!! :)

Noah Richards November 10 2013
| Edit |
Delete

2.5 should now support VS2013. Ctrl-shift-click doesn't do find all, but it is now ignored (per another user's request).

by Jan Mazur | October 19 2013

+1 for the VS2013 support

Noah Richards November 10 2013
| Edit |
Delete

2.5 should now support VS2013. Let me know if you run into any issues, thanks!

by Kurt Dowswell | October 18 2013

Please add VS 2013 support! Love this extension. Use it countless times per day :)

Noah Richards November 10 2013
| Edit |
Delete

2.5 should now support VS2013. Let me know if you run into any issues, thanks!

by f00nth | October 04 2013

by Gameme | September 23 2013

Its awesome to get a navigation style similar to source insight. I love it.

by Stefanos Anastasiou | August 24 2013

This plugin is using a hack, which makes it unusable with DSLs.

The plugin, uses the following export type:

[ContentType("code")]

And in addition it tries to highlight and subsequently find symbol definitions, for every classification span which happens to have the following characters in them

if ((name.Contains("identifier") || name.Contains("user types")) &&
SetHighlightSpan(classification.Span))
{
updated = true;
return true;
}

i.e. "identifier", "user types"

I know of no language, which doesn't have an "identifier". So it is very probable that any DSL will not work with the plugin.

The funny thing is, that the plugin somehow managed to creep into power productivity tools 2012, and since everyone uses those, they also use the plugin.

We had to change our DSL in order to continue using the plugin..

The plugin should only support only languages which do support this feature natively, than trying to invoke "find symbol definitions" for all languages which happen to export an "identifier" token.

Noah Richards August 24 2013
| Edit |
Delete

Sadly, there wasn't a non-hacky way to implement the extension, and there's no way to determine which languages "support this feature natively". Since Go To Definition wasn't designed as a queryable command, the extension had to use some broad guessing at what has definitions, and it actually under guesses for certain scenarios (I remember one or two in VB, at least).

I'd be happy to at least modify this standalone version to avoid loading for documents that use your DSL language type and you could file a Connect bug to get it integrated back into the PPT extension . Fee free to either add a Q&A comment here or a github bug (https://github.com/noahric/gotodef/issues) with the details, or make the modifications yourself and send me a pull request on github.

by Code Buddha | August 07 2013

This made my day. You're awesome. Thanks!

by uonun | August 04 2013

1 - 20 of 61 Items   
Sign in to start a discussion


  • ctrl+click for "go to", ctrl+shift+click for "open peek window"
    1 Posts | Last post June 22, 2014
    • hi!
      is it possible that you add ctrl+shit+click to open peek window at location? (alt+f12)
      
  • Make the addin work with other windows like Output
    2 Posts | Last post June 02, 2014
    • I used to use the "Go to definition" feature of pre-2012 versions of Visual Studio to navigate identifiers that came from build errors (which happens excessively often when something goes wrong while comipiling templates).
      
      It is counter productive to have to copy/paste identifiers from the build output to a code window that does not deserve polluting, only to then use the addin.
      
      Would it be possible to make this addin work in the context of any text window, like the build output?
      
      Thanks
    • It may be possible, but definitely not straightforward. The extension itself doesn't actually do the "Go to definition" logic, it just basically triggers a press of F12 (the GoToDefinition command). If F12 does work in the output window, then it's just a matter of getting the extension there and figuring out what to underline on ctrl+mouseover.
      
      -Noah
  • Go To File
    1 Posts | Last post May 13, 2014
    • It would be nice if it did open includes (the equivalent of Ctrl+Shift+G).
      
      I also second that Ctrl+middle click should open peek
  • Go to definition across different languages
    1 Posts | Last post November 28, 2013
    • I've had a problem for ages while working on a legacy site that was built in VB.NET and we've added C# projects to it.
      The problem seems to be that Go To Definition doesn't work across the projects. 
      I even tried setting up a test solution to see if the problem existed on a brand new one and it still did.
      
      I've tried all the solutions I've found on the net around using Project References and not File ones but nothing seems to work.
      
      Well, one thing works. ReSharper. Unfortunately, ReSharper is quite overkill just to get Go To Definition working properly...
      
      Is there any chance your extension could fix this bug and enable the Go To Definition (And Find Usages if possible :P) across projects?
  • Can this be modified to perform a Peek Definition?
    3 Posts | Last post November 20, 2013
    • I love this extension.
      
      Is it possible to have a different combo (perhaps CTRL+ALT + left click) do a peek definition in addition to the default CTRL + left click performing a goto definition?
    • Hey Noah.
      
      I'm not comfortable in making this change myself. Given your response to my review comments indicating that it wouldn't be too hard to implement peek definition and find all references with a non-configurable key combination, would you consider?
      
      Perhaps:
      CTRL + Left Click == goto def
      CTRL + Middle Click == peek definition
      CTRL + Right Click == find all references
      
      what do you think?
    • ...well now that MS's PPT 2013 extension is out, which can do a peek definition with the ctrl-click, I guess this request (and extension) is no longer needed...
      
      unless this one provides the ability to do both (peek and goto def) via different mouse buttons / key combo.
  • [Shift] + [Ctrl] + Click
    3 Posts | Last post November 10, 2013
    • without this plug-in, when I click on a word, hold [Ctrl] and [Shift], and click on another word, it selects the everything between both clicks including the whole words.
      however when I have this plug-in installed it tries to jump to the word I click on even if it isn't a hyperlinked one.
      
      it would be nice if you ignored jumping if, other keys were pressed, specifically in this case the [Shift] key.
    • Hi, the functionality you're describing doesn't require the use of the Ctrl key. Click once in the file, then Shift+Click to where you want the selection and it should select everything in-between. Ctrl is not needed.
    • Hey Ben, 2.5 should now ignore shift+ctrl as a combination. Let me know if you get a chance to try it out. Thanks!
  • Please make this work with VS13
    5 Posts | Last post November 10, 2013
    • I love this little extension please make it work for vs 2013
    • +1 
    • Highly needed for VS2013!
    • Sorry guys! I'm working on it, but I lost my windows VM and so I had to rebuild things (a few days of installing software and updates). I should be all set up to rebuild and then test with vs2013, so I'm hoping to get it done this weekend.
      
      -Noah
    • 2.5 should now support VS2013. Let me know if you run into any issues, thanks!
  • Ctrl+Click works for all possible tokens in DSL
    7 Posts | Last post August 26, 2013
    • @Noah, I changed the names of the "identifier" DSL tokens so that the "conflict" doesn't exist anymore. But now I have another problem, which only occurs while the documents of my DSL are part of a C++,C# project. 
      
      GoToDef tries to find the definition of all tokens in my document, even though the names of the tokens are completely irrelevant with your extension. 
      
      The funny thing is, that only the tokens I allow in my extension are underlined, but when I click, your command handler is invoked rather than mine. 
      
      All this started to happen, as I added an ILanguageInfo implementation to my plugin. If I remove this, everything works as it should.. 
      
      Any ideas ?
    • Correction, it occurs even if the document is not part of a C++ project. The underlining works fine according to my plugin - but the cursor does not change and when I click on an item your command handler is getting called instead of mine.
    • During debugging, I found out that your command handler is called after my command handler. I think I will have to debug your plugin :).. I'll keep you posted.
    • I managed to workaround through your plugin. I had to implement IVsCodeManager and add a filter for my textview in between. 
      
      Would it not help if you export your plugin only for C++,C# etc. instead for text content type ?
    • (When you say "text" content type, are you talking about the classifier? The mouse handler is "code", so the rest of the question assumes you meant that)
      
      > Would it not help if you export your plugin only for C++,C# etc. instead for text content type ?
      It would probably help your specific issue to enumerate which content types support GoToDef, though then it'd have the opposite problem from this: opt-in instead of opt-out, so it would miss supported languages. It turns out that many/most third party languages, even DSLs, tend to implement Go To Definition for *something*, even if it isn't a "definition".
      
      Your case is an interesting one, though. Content types don't provide an anti-list, so there's no good way to say "code, but not some other content type". Added to that, VS doesn't ship with a standard "DSL" content type or, more appropriately, an "I-support-Go-To-Definition" content type, so all the extension can really do is guess. I had always hoped that the product team would make it a part of VS and make it possible for these to be less hacky, but the good/bad thing is that the extension tends to work pretty close to correctly in most scenarios, so I don't think there was a strong desire to spend the extra effort making it perfect. I wouldn't know, though, as I left VS/Microsoft over 2 years ago.
      
      As for the mouse handler, if your handler is being called first and you don't want anything else to happen with that mouse event, you can mark e.Handled to true. It may not be the right solution in the general case, since there may be some later default behavior that's desirable, but it's worth testing, at least.
      
      All said, I'd still be happy to add some manual logic (to the mouse handler provider) to have it skip files of your DSL's content type, or some base content type that you've created and that others could use to opt-out. Just let me know, or send me a pull request on github.
      
    • Sorry, yes I meant code. The funny thing is, I tried debugging your plugin and it actually works as expected, because now I am exporting a content type specific for my DLS which does not even derive from text.
      
      But with power productivity tools it does not work. As this code is not open source, I can't debug, now do I have any idea where the problem may lie.
    • You can probably use .NET reflector to see what the productivity power tools version is doing.
      
      If this version of the plugin isn't incompatible with your plugin, you may want to consider moving/copying your review or other pertinent information to that extension's page. I don't have any control over that version and I don't even know who works on it (internally at Microsoft), so I won't be of much help there, sorry :(
  • Using Peek Definition in VS 2013
    2 Posts | Last post August 21, 2013
    • VS 2013 has a new feature called Peek Definition that is similar to Go To Definition but it shows the definition in line with your current location instead of opening the definition in a new window.  It would be cool if this extension could support Ctrl-Click to either Go To Def or Peek Def.
      
      http://msdn.microsoft.com/en-us/library/vstudio/dn160178(v=vs.120).aspx
      
      BTW, this extention works in VS 2013 by unpacking the VSIX and adding a VS 12 to the <SupportedProducts> collection in the extension.vsixmanifest file.
    • Assuming that peek def has a new command group and command id, it would just be a matter of figuring it out and substituting it here:
      https://github.com/NoahRic/GoToDef/blob/master/GoToDefMouseHandler.cs#L340
      
      Looking through the docs for 2013, it looks like you want:
      Microsoft.VisualStudio.VSConstants.CMDSETID.StandardCommandSet12_guid
      and
      Microsoft.VisualStudio.VSConstants.VSStd12CmdID.PeekDefinition
  • How to Switch to "Highlight-Word-Under-Cursor" as in SSMS?
    2 Posts | Last post July 31, 2013
    • Hi all.
      
      Is it actually possible to change this?
      Double-click is not convenient for me and I have been using SQL Server Management Studio with CTRL+Click to highlight a word for years.  In many situations with partial replacements this is the fastest method.
      
      Thank you,
      Rafael
    • Aha, found it!  Tools==>Options==>Productivity Power Tools -> turn off the feature in the right pane :)
1 - 10 of 29 Items