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.

(42) Review
Visual Studio
2012, 2010
Download (89,896)
8/16/2012
2.4
View
E-mail Twitter del.icio.us Digg Facebook
Add To Favorites
Description
Reviews (42)
Q and A (19)
Sign in to Write a Review
Sort By:

by Petr Škaloud | May 15 2013

Exactly what I need :) Thanks a lot, it is great job.

by lioncall | December 22 2012

Great...thank you.

Having the option to open in Preview Tab would be wonderful!

by Wirwing | December 01 2012

Can't live without it!

by Paulius Žaliaduonis | November 09 2012

Useful.

by Shimmy Weitzhandler | October 31 2012

Great tool very useful!

I have another good suggestion:
When in debug, Ctrl + Click (or Ctrl + Right Click) should lead to Quick Watch.

Thanks Noah!

by Roberto Yglesias - Buildingi | October 30 2012

This should be a default functionality on VS by now...

Thanks for the contribution!

by tbomb80 | October 18 2012

Keep up the great work!

by Urbanion | September 21 2012

Should be as default feature.

by Muckrucker | September 18 2012

by RudolfG | September 16 2012

Must have !!! :-)

by Andre.Ziegler | September 13 2012

absolutely must have extension for VS

by lucianomx | August 29 2012

Why isn't it default or at least native (configurable) in Visual Studio ?

by Cyril EVL | July 16 2012

Simple, but very useful :)

by JohnLeo Carton | July 07 2012

How did i survive without this!!!

by Mr. Wharty | June 08 2012

Brilliant little utility

by maxima | May 29 2012

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!! :)

by Sean Ireson | October 21 2011

perfect! should be included out of the box.

by Ehsan Mohammadi | October 08 2011

by cportwood | September 16 2011

Simple but awesome extension. I'm spoiled now... I get a put off when I try and use someones machine that doesn't have this.

by OctoberS | July 16 2011

Thank you for this very much!

1 - 20 of 42 Items   
Sign in to Start a Discussion


  • About the modifier
    4 Posts | Last Post October 21, 2010
    • Is there any method to set the modifier which trigger the go-to-definition feature?
      
      I am used to hold the Ctrl to select multiple words as a whole. This behavior conflicts with the functionality of this extension.
      
      A selection check before triggering is fine for me.
    • Thanks Mason, that's an item to put on the backlog.  I'm mulling over how to expose it, as putting a single options page somewhere in Tools->Options just to select some combination of alt/ctrl/shift seems overkill, but there isn't really another common location to put that option.  If you have any ideas, that would be helpful, too :)
      
      -Noah
    • Hi Noah,
      
      I would really like to use this extension but I do not want to "sacrifice" my Ctrl DblClick. 
      
      The trigger customization is something that I consider as an enormous benefit for this expansion. I am even absolutely fine with specifying the trigger key manually in the .config file.
      
      Cheers 
    • Hey taras_b,
      
      Do you use ctrl-click or just double-click?  They do the same thing, and this extension (should) only affect the former.  If you are used to double-clicking to select a word, then you just need to un-train yourself to hold down control when you do it.
      
      I'll keep the .config option in mind.  Also, if you are up for it, you could try grabbing the source (http://github.com/NoahRic/GoToDef) to change it yourself.  It's unfortunately not well factored to make it a completely trivial change, but it should be about as easy as replacing all instances of ModifierKeys.Control with ModifierKeys.Alt.
      
      Thanks,
      -Noah
  • New version 2.2
    10 Posts | Last Post July 02, 2010
    • Version 2.1 worked better for me. The new version does not react as I aspect. Clicking first Ctrl and then perform a mouse click does not work any more.. Now it reacts sometimes if a perform a mouse click first and then press ctrl. Is there a possibilty to get the version 2.1.
      
      Thanks,
      Chris
    • Hey Chris, I'm not quite sure what you mean :(  I generally use it by holding down the ctrl key and then clicking, which is what it sounds like you are saying doesn't work.  Could you give me a bit more information on what isn't working?
      
      To get version 2.1, you can download the source at that point (http://github.com/NoahRic/GoToDef/zipball/2.1) and build it yourself, once you've downloaded the SDK.
      
      Thanks!
      -Noah
    • Hi Noah,
      exactly that is what doesn't work. I'll give you some scenarios and what then is happen.
      
      1. Holding down ctrl and then moving the mouse to the word --> Nothing is happen
      
      2. Moving first to the word then holding down ctrl --> Color of the word is changing and the word is underlined, mouse pointer is sometimes changed
      
      3. Moving the mouse after 2. --> Mouse pointer is rechanged and will never changed back, word is sometimes still blue and underlined
      
      4. Clicking after 2. --> Nothing is happen
      
      5. Moving first to the word then clicking and holding the mouse button down and then holding the ctrl key and finally release the mouse button --> Performs as I expected on 4.
      
      
      Since version 2.1 works fine for me, I will use this version again.
      
      Thanks,
      Chris
      
    • Do you have any other extensions installed (like the pro power tools)?  It's possible there could be something conflicting there.  I still can't repro it, so there isn't much I can do to fix it for you, sorry :(
      
      -Noah
    • No problem.
      
      There are some other extensions in the extension manager:
      - DevExpress Tools
      - Enterprise Library v5 Configuration Editor
      - Go To Definition
      - Highlight all occurrences of selected word
      - PowerCommands for Visual Studio 2010
      - Regex Editor
      - Visual Studio 2010 Pro Power Tools
      
      But I find a solution so I'm happy again :-)
      
      - Chris
    • Hi Noah,
      finally I checked all extensions. Disabling 'Highlight all occurrences of selected word' let the problems disappear. But version 2.1 also fixes the problems ;-)
      
      Best regards
      Chris
      
    • Ah, I think I can repro it now.  I'll see if I can figure out what's causing the issues.
      
      Thanks!
      -Noah
    • Hey Chris, can you try out v2.3?  Let me know if it fixes the bugs you were seeing.
      
      Thanks!
      -Noah
    • Hi Noah,
      v2.3 does not solve the problem unfortunately.
      
      - Chris
    • I'm not sure what else it is, then :-/  It could be an interaction with the DX tools or Nick's highlight references extension (I didn't realize earlier that you had that extension installed; when I saw "highlight references", I assumed the built-in feature).  Unfortunately, the only ones I have source for are the pro tools (since it is a copy of this extension) and the regex editor.  While the regex editor's implementation of mouse handling is suspicious, it shouldn't be causing a problem except on lines that have "new Regex(".
      
      Sorry :(
      -Noah
  • [Suggestion] Drag-drop compatibility
    17 Posts | Last Post June 22, 2010
    • By default Ctrl + drag mapped to text copy. The extension overrides this behavior. Please, fix it (at least add an option "do not navigate if click on selected text").
    • Hey Sinix,
      
      To get around it, you can select the word, start the drag operation, and *then* hit control before you let go of the mouse button when you drop.  Let me know if that works for you.
      
      -Noah
    • Noah, this is workaround and it decreases usability of the extension. Try copy with mouse hyperlink 
      in winword. It's the right behavior. Need to change your mind every time new extension appears is wrong. 
      
      The fix I've suggested (just do not navigate on click on selection) is simple. Why not implement it?
    • The fixes you suggested are not simple in this context, unfortunately.  I may try moving the logic back to handling mouse up events and deal with the other issues that crop up (as the extension worked when I first wrote it), but it isn't a simple change.  In the editor, mouse interaction is handled in a decentralized and often hard-to-debug manner, which is what makes this complicated in the first place.
      
      If you'd like, you can download the source and make the change on a private version of the extension you are running; the source can be found on github here: http://github.com/noahric/gotodef.  If it really is as simple as you say, it should be easy for you to fix.
      
      In the meantime, if I get some time this weekend I'll take a look at fixing this.
      
      Thanks!
      -Noah
       
    • Sorry, forgot to add: the hard part of the fixes you mentioned ("fix it", and "add an option") are the mouse interaction for the first part (as I describe in my previous post) and adding an option page (involves adding a package   options page   some hackery for WPF options pages).  Just changing it to not navigate when clicking on the selection wouldn't be difficult, but I don't think that's the right default behavior.  However, it should be pretty easy to make that change in a private copy and run that on your own machine.
      
      Thanks!
      -Noah
    • May be it'll best to align with all links/buttons behavior and navigate on mouse up.
      However, there is cludge (done in 5 mins; not debugged yet but seems to work). 
      
      Just one line:
      //  Now, check for valid classification type.  C# and C   (at least) classify the things we are interested
      // in as either "identifier" or "user types" (though "identifier" will yield some false positives).  VB, unfortunately,
      // doesn't classify identifiers.
      foreach (var classification in _aggregator.GetClassificationSpans(extent.Span))
      {
        var name = classification.ClassificationType.Classification.ToLower();
        if ((name.Contains("identifier") || name.Contains("user types")) 
    • Sorry, text seems to be trimmed.
      
      if ((name.Contains("identifier") || name.Contains("user types")) 
    • hmm.. Ok. Just added this exactly after last if (delete other posts if possible, please).
      if (!_view.Selection.SelectedSpans.Contains(classification.Span))
    • Yeah, as I said in my last post, though, I don't want to make that change by default ("Just changing it to not navigate when clicking on the selection wouldn't be difficult, but I don't think that's the right default behavior.")  The hard part is fixing it without introducing that behavior or introducing that behavior as an option.
      
      Thanks!
      -Noah
    • Agreed.
    • Second this one.
    • How about just using a shift/click as an option?
    • Bob, the right design is to align behavior with common rule: buttons and links are clicked on mouse up. After that, it's quite simple to ensure that mouse moved out of drag-drop threshold and do not navigate.
    • Here is what I get when the extension is installed:
      
      Highlight the element.
      Hold control key down (underlines).
      Mouse-down on the highlighted/underlined text.
      Goes right to definition (does not wait for mouse up).
      
      When the extension is not installed, BTW, I am not able to copy drag anyway.  Holding the control key down simply extends the highlighting when the mouse is clicked and dragged.  Is this a bug or a "feature" in 2010???
      
      Thx.
    • Bob, when I said "the right design..." i meant "how things should be done". Sorry if mislead you.
      
      Confirmed - when extension disabled or uninstalled, ctrl should be pressed after mouse key. "Feature", I think.
    • Oh, silly me.  I didn't realize that the decades-old convention on copy/drag had been changed in VS2010.
      
      Thx,
      Bob
    • Bob - it didn't change in VS2010, though this extension conflicted with it.
      
      Bob and Sinix - could you guys give 2.2 a try, if you are still interested in using the extension?  I've updated it to work with mouse up and worked around some of the original issues I ran into, so this should now work more sensibly with word selection and drag/drop.
      
      Thanks!
      -Noah
  • Conflicts with Ctl-Click
    1 Posts | Last Post June 02, 2010
    • Just a suggestion:
      I like to use another extension that supports regex editing using ctl-click on a literal string. Obviously that conflicts with this extensions user of ctl-click. I am guessing this conflict may also be affecting other people. I was wondering if it would be possible to add an option to disable the ctl-click functionality for literal values. 
      As an aside it would be nice to be able to do the next-reference thing also as an option. eg on alt-click.
  • Bugs in extension
    1 Posts | Last Post May 27, 2010
    • Sometimes clicking Ctrl+LeftMouse and hitting F12 on the same symbol go to different places.
      And built-in VS feature goes to the right place, but Ctrl+Mouse goes to the wrong place.
      Why is it so?
  • Silly Qiestion - from another MSFTie
    2 Posts | Last Post December 14, 2009
    • 
      Hi Noah - I haven't tried, but curiously why does a task that (to me) seems very straightforward - assigning an action to a mouse+key combo - need an extension? Isn't there someway using the keyboard options to do this?  
      
    • You can absolutely use the keyboard to do this; by default, F12 is bound to "Go To Definition", and there is also an entry in the context menu of the editor and (I think) the VS menu (so you could use alt shortcuts).  However, there are some benefits of having this type of extension/feature:
      
      1) The url-esque underlining is a nice visual hint for what items have definitions.  This extension doesn't do this perfectly, but it does help somewhat.
      2) It's one fewer action (click vs. click to move caret and then hit F12) per navigation.  This doesn't sound like a lot, but it can be useful to just navigate from definition to definition by holding down (and not letting go of) the control key and clicking around).
      3) It's also more comfortable to leave your left hand on the control key and leave your right hand on the mouse to navigate than it is to either leave your left hand hovering over F12, moving the left hand to F12 each time (which probably requires that you look at the keyboard each time), or moving the right hand to F12 each time (which is the worst case - you have to look at the keyboard and you spend time moving back and forth between the mouse).
      
      In any event, it isn't a feature that everyone wants or needs, so download it and try it out if you are curious to see what it is like :)
      
      -Noah
  • version 1.1
    2 Posts | Last Post November 02, 2009
    • Where I can get version 1.1 for Visual Studio beta 1
    • There isn't one published anymore, but you can grab the sources from github from before the changes to update the extension for Beta 2.  This should be the one:
      
      http://github.com/NoahRic/GoToDef/tree/052b0a2c27bc215460231ab7c05266fea6791dfa
      
      -Noah
  • VS2005 support ?
    2 Posts | Last Post May 27, 2009
    • This is an amazing tool, but unfortunately I'm still using VS2005. 
      Is there or will be a version for VS2005 too ?
      Thanks
    • Sorry, no - this is an extension for the new editor in VS2010.
      
      -Noah
  • Does it work for C/C++?
    2 Posts | Last Post May 24, 2009
    • Does this extension work for C and C++? and can you chose the color of the selected identifier? (the default blue)
    • I played around with C   for a bit, and it does appear to work for it, since the C   and C# languages services do a lot of things very similarly.  Technically, it makes ctrl click invoke GoToDefinition on whatever word you click on (even if it isn't underlined), so it works in any language.  The underlining works by detecting which words are classified as some type of "identifier" or "user type", which C   and C# both do.  VB, unfortunately, doesn't classify all identifiers/user types, so few things will get underlined.  I didn't play around with F# or aspx at all, though the underlining may work to a varying degree with those as well.
      
      You can't change the color of the identifier in the Fonts and Colors options dialog (due to an issue in beta 1), but you could change it programmatically or by modifying the source.  I'm hoping to get this extension and the ItalicComments up on codeplex or someplace similar in the near future.  In the meantime, if you'd like, I can help you write a little extension for yourself to change the color or get a modified version of this extension with a different color.  You can ping me at noahric at microsoft.
      
      Thanks!
11 - 19 of 19 Items