The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,316 other followers

“Cannot navigate to definition” annoyance in Visual Studio 2010 – (did it implement the mouse equivalent to Delphi code browsing? No, it didn’t)

Posted by Jeroen Pluimers on 2012/03/08

This use case drove me nuts in Visual Studio 2010 for a while, but can be solved.

Use cases:

  1. Cannot navigate to definition.double click on a word to select it
  2. press Ctrl-C to copy the selected text
  3. result is either of these two dialogs:

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    Cannot navigate to definition.
    ---------------------------
    OK
    ---------------------------

    Cannot navigate to definition. The cursor is not on a symbol.or

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    Cannot navigate to definition. The cursor is not on a symbol.
    ---------------------------
    OK
    ---------------------------

The reason is that Visual Studio 2010 still thinks I am clicking the identifier (which I’m not, I just released the mouse button) while pressing the Ctrl key.

Actually I never realized that Visual Studio 2010 incorporated the same form of Ctrl-Click code browsing that I got accustomed to since Delphi 4 in 1998 :)

Whereas the Delphi code browsing keyboard shortcuts are the same as for web browser keyboard shortcuts (like Alt-Left/Alt-Right and Browse-Left/Browse-Right), I have gotten accustomed to the odd Visual Studio keyboard shortcuts F12 (go to definition of symbol), Ctrl-Minus (navigate to previous editor position) and Ctrl-Shift-Minus (navigate to last cursor location).
That is fine with me. When switching between Visual Studio, Delphi, Xcode, etc, I mentally switch to different sets of keyboard/mouse usage anyway.

But did Visual Studio implement this natural way of code browsing?

No, it didn’t, and it took the  “Cannot navigate to definition” annoyance in Visual Studio 2010 question on Stack Overflow for me to realize that.

The code browsing is actually provided by the Productivity Power Tools for Visual Studio by Microsoft:How to disable the "Ctrl + Click Go To Definition" extension of the Productivity Power Tools

Ctrl + Click Go To Definition
This extension gives the editor a web browser by adding clickable hyperlinks to symbols in your code as you hold down the Ctrl key.

And that extension is buggy :)

But: since you can individually disable extensions in the Productivity Power Tools, it is easy to workaround: go to “Tools Options>Productivity Power Tools” and you will see a dialog similar to the image on the right (click to enlarge). Then turn off the Ctrl + Click Go to Definition and press the OK button, and restart Visual Studio.

–jeroen

via: “Cannot navigate to definition” annoyance in Visual Studio 2010 – Stack Overflow.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 1,316 other followers

%d bloggers like this: