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,940)
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


  • Visual Studio 2012 Express
    3 Posts | Last Post April 24, 2013
    • Is the extension working in visual studio express 2012?
      
      I use it in visual studio professional 2010 and I can't live without it!
      
      I am trying vs express 2012, but i am not able to install gtDef, it says it's already install for all possible products...
      
      Thanks and keep up the good work!
    • The Express editions of VS don't support any (non-microsoft) extensions, sorry!
      
      -Noah
    • You can use this short autohotkey script to do this with middle mouse button. Just store this code as .ahk file and run it.
      
      SetTitleMatchMode, 2
      #Persistent
      #IfWinActive, Microsoft Visual Studio Express
      MButton::
        Click
        Send {F12}
        Return
      #IfWinActive
  • Does not jump on Ctrl+click, but jumps on F12
    1 Posts | Last Post January 10, 2013
    • Hi, it seems I have found some kind of conflict with another extension: "Highlight all occurrences of selected word" (http://visualstudiogallery.msdn.microsoft.com/4b92b6ad-f563-4705-8f7b-7f85ba3cc6bb)
      
      The extension highlights all occurrences of a selected word in the current document. My usual use case is to double-click an identifier, look at it's highlighted occurrences in the current context and then ctrl+click it to go to the definition. When I disable that highlighting extension I can navigate using ctrl+click, otherwise I get the highlighting on ctrl+click. 
      
      It is reproducible on a tiny snippet like this:
      #include <iostream>
      int main(int , char**) 
      {
          int myint = 5;
      
          std::cin >> myint;
          myint += 1;
          std::cout << myint;
      }
      
      I am using VS 2010 and the 2.4 version of your extension.
      Could you suggest any workaround?
  • Doesn't work for ids of HTML elements
    8 Posts | Last Post November 28, 2012
    • This simply doesn't work for me. It only works for classes.
      
      Using 2.4 with VS 2012.
    • What language?
    • To be fair, I've never tested this with VS2012 (I've never used VS2012). If the classification of method names has been changed, it would stop the extension from working. It currently only matches:
      if (name.Contains("identifier") || name.Contains("user types"))
      
      If you (or anyone else) can let me know what the name is, I can add it to that list pretty easily.
    • Language: HTML.
      
      I don't know an answer to your other question. Would you be able to download a trial version of VS 2012 and get the information you need?
      
      Alternatively, could you guide me into obtaining an answer for you?
    • I'm not sure I remember what it is supposed to do in HTML.
      
      If you click on something that isn't underlined but you think should be, and you press F12 (or whatever Go To Definition is bound to), does it navigate someplace? If you have the extension installed, you can do the same by ctrl-clicking, even if it isn't underlined, if that helps.
    • F12 also ignores ids and also works for classes.
    • This won't work in any case that F12 doesn't, it just programmatically invokes F12 (+ a heuristic for the underlining).
    • Got it. I have filed a bug report about this: https://connect.microsoft.com/VisualStudio/feedback/details/772443/pressing-f12-doesnt-take-users-to-css-definitions-based-on-ids-of-html-elements. I hope other could reproduce it, click on the "I can too" link there and also vote for the bug.
  • Bug in implementation wich conflicts with word selection
    2 Posts | Last Post October 29, 2012
    • Hi, 
      
      I believe there is a bug in implementation which causes this extension to conflict with word select functionality of the editor - i.e. when CTRL is pressed, mouse selection is automatically extended to words. I guess operator "&&" should be replaced by "||" in this method
      
              private bool InDragOperation(Point anchorPoint, Point currentPoint)
              {
                  // If the mouse up is more than a drag away from the mouse down, this is a drag
                  return Math.Abs(anchorPoint.X - currentPoint.X) >= SystemParameters.MinimumHorizontalDragDistance &&
                         Math.Abs(anchorPoint.Y - currentPoint.Y) >= SystemParameters.MinimumVerticalDragDistance;
              }
      
      i.e. current code detects only 'diagonal' drags, but it should work if drag is done along X or Y axis too.
      
      Thanks for this extension, BTW :).
      
    • Looks like a bug indeed :) Funny thing is that I'm pretty sure that code looks nearly identical to the drag/drop mouse handler built in to VS. I'll update the code shortly (and the extension at some point after that; that may take a little while). Thanks!
      
      -Noah
  • Go To Implementation?
    2 Posts | Last Post September 28, 2012
    • I am using Resharper, which provides Go To Implementation in the context menu, which is very useful, as we use interfaces heavily.
      
      I'd love to be able to override the Ctrl+Click behaviour to go to the implementation instead, which is far more common usage than going to the interface.  I suspect you might not be able to pull it off though if it's only built into Resharper?
    • Assuming they register it as a command, you could modify the extension to call that command in DispatchGoToDef:
      https://github.com/NoahRic/GoToDef/blob/master/GoToDefMouseHandler.cs#L340
      
              bool DispatchGoToDef()
              {
                  Guid cmdGroup = VSConstants.GUID_VSStandardCommandSet97;
                  int hr = _commandTarget.Exec(ref cmdGroup,
                                               (uint)VSConstants.VSStd97CmdID.GotoDefn,
                                               (uint)OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT,
                                               System.IntPtr.Zero,
                                               System.IntPtr.Zero);
                  return ErrorHandler.Succeeded(hr);
              }
  • Please rebuild to also target Visual Studio 11 Beta
    2 Posts | Last Post April 26, 2012
    • Some of the Productivity Power Tools extension for VS2010 are already included in VS11, but Ctrl+Click is not one of them.
      
      How hard would it be for you to have your "Go To Definition" extension also target VS11 Beta?
    • You can do it yourself.
      1. Download this extension.
      2. Rename GoToDef.vsix to GoToDef.zip
      3. Extract all the files in GoToDef.zip
      4. Open up the extension.vsixmanifest
      5. Change the <VisualStudio Version="10.0"> to <VisualStudio Version="11.0">
      6. Save
      7. Zip all the files (GoToDef.zip)
      8. Rename the GoToDef.zip to GoToDef.vsix
      9. Install the vsix
      10. Enjoy
  • Please add option to address Go To Definition to Object Browser instead of metadata
    2 Posts | Last Post January 29, 2012
    • SEE:
      http://connect.microsoft.com/VisualStudio/feedback/details/667889/allow-addressing-go-to-definition-to-object-browser-rather-than-metadata#tabs
    • Overriding the GoToDefinition command behavior is orthogonal to this extension. If you want an example of how to write a command handler, take a look at the FixCtrlBackspace source here: https://github.com/NoahRic/Random/blob/master/FixCtrlBackspace.cs
  • Similar Navigate for custom control onclick
    1 Posts | Last Post December 30, 2011
    • This is a great tool!  If I have a custom server control with a onclick event.  How can I add this functionality to my custom control to jump to subroutine?  Thanks.
      Brent
  • Navigate to previous statement
    3 Posts | Last Post December 25, 2011
    • When press Ctrl + Click, this will jump to the method's definition, this is very helpful.
      
      I am very appreciate if you can add "Jump back" function to this addin (like Shift + click method's name).
      
      Thanks in advance.
    • View.NavigateBackward should do the trick. It'll be bound to Ctrl+- (ctrl minus) by default, or your mouse's back button, if it has one.
      
      -Noah
    • This is a great tool!  If I have a custom server control with a onclick event.  How can I add this functionality to my custom control?  Thanks.
  • combination Shift + Click
    2 Posts | Last Post March 24, 2011
    • It would be very useful if you use a combination of Shift + Click
    • Yeah, that is feedback I've heard before :)  I'm not really open to the idea of changing the default, but I am open (in principle) to adding an option to change the modifier.  That's a large enough bit of work that I haven't gotten around to it yet, though, and probably won't in the near future.
      
      Your best bet is to build the extension yourself.  You can grab the source on:
      
      http://github.com/noahric/GoToDef
      
      You'll want to modify GoToDefMouseHandler.cs to replace the two instances of ModifierKeys.Control with ModifierKeys.Shift. That *should* be all that's needed, though there very well may be issues you run into with the new shortcut conflicting with other mouse gestures.
      
      (Also, to build the extension, you'll need the VS2010 SDK installed).
      
      If you try to build it yourself and have any issues, let me know.  I'll try to help as best I can :)
      
      Thanks,
      -Noah
1 - 10 of 19 Items