views:

29

answers:

1

Visual studio has predefined command that are accessible by type ctrl + /. For example >of myfile.cs will open the file named myfiles.cs

I would like to have a command to go to definition of any type. For example >gotodef TextBox would do the same as if I pressed F12 on the word "TextBox" in the source code editor (view it shows all members of the type from the dll metadata).

Any ideas ?

+1  A: 

Those commands are known as "aliases", and yes you can add your own ones.

The one you want is called Edit.GoToDefinition

So to register it you would type this:

>alias gotodef Edit.GoToDefinition

and then to use it, type:

>gotodef TextBox

See here for details.

demoncodemonkey
The alias creation works but the command execution does not work because the argument is discarded.The command will go to the definition of the object where the cursor is, not TextBox.
clems