C# Tools that can be used to replace F12 command - visual-studio

I was curious if there is/are tools that can be used to embed so the the function name in C# can have a link in order to jump to its definition. In this case no need to right click and select 'go to definition' or F12. I was having hard time explaining what i meant. Hope someone can understand. Thanks a lot.

Ctrl + Left Mouse Button does the trick. Just Ctrl+Click the name of the function.
(assuming you are using Visual Studio with JetBrains ReSharper plugin).

Not sure if I understand what you are after, but ReSharper from JetBrains is an incredibly powerful addin to Visual Studio.
One of the functions is a replacement of the Go to Definition function.

There is an extention in the visual studio gallery which allows Ctrl+Click Navigation
http://visualstudiogallery.msdn.microsoft.com/4b286b9c-4dd5-416b-b143-e31d36dc622b?SRC=VSIDE

Related

"Beautify" Brackets Equivalent for Visual Studio IDE

I've got a question. As Brackets WebDev IDE has its plugin called Beautify to clean up the syntax, make it more readable, is there some Visual studio Package with such function?
Every answer matters :)
Cheers
I don't know about an extension as such, but if you press Ctrl+K and then Ctrl+F in sequence it will auto-indent your code for you. I believe the style of auto indentation you want can be configured in the Settings pane.

Visual Studio code completion like ctrl+k in netbeans?

My question is there code completion for Visual studio like in Netbeans where you cycle the buffer with ctrl+k, when you type something?
There's now a nice extension called Simple Autocomplete which adds one command simpleAutocomplete.next that you can map to a shortcut of your choice.
No, there isn't a similar feature in Visual Studio.
The traditional Visual Studio autocomplete is using intellisense.
When you start typing, intellisense may bring up a drop down with suggestions. In that case you can tab to complete using the current suggestion or use the arrow keys to choose another.
Ctrl-Space (or Alt-Right arrow) will bring up this intellisense menu if it's not up.
I find it does a pretty good job overall.
Some extensions like Resharper or Visual Assist offer their own code completion or other similar features (like Suggestion List for Visual Assist).
I know it's been ages since I asked this question but I found the next best thing to do this. What I would suggest is to use VsVim extension and to use Vim's anyword completion; however, in order for this work, what must be resolved is the keyboard shortcuts that conflict:
Go to "Tools options" in Visual Studio.
Then go to VsVim category(alternatively you can search "VsVim" and
should bring the options) and click keyboard.
As far as I know vim deals with this type of completion with these keys
CTRL+P and CTRL+N so what we do is to let Visual Studio give up
these keybindings and let VsVim deal with it by Selecting from the drop
down of the keys(CTRL+P and CTRL+N) and let it be "Handled by VsVim".
I hope this has helped someone out.

Find usage in Visual C++ with Visual Assist

I am using VS 2010, does Visual C++ with Visual Assist provide refactor functions on finding usage of variables? I right click the variable and the find usage function is always grey out.
Find All References in the context menu is the IDE version of the command.
To use Find References from Visual Assist, try one of:
open the "Refactoring (VA)" sub-menu of the context menu
use the default shortcut Shift+Alt+F
open the Quick Refactoring Menu with Shift+Alt+Q ("refactoring" is used loosely in this instance.)
It works for me right clicking on a variable and selecting Refactor (VA) - Find References.

Highlight all references to X?

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.
If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.
I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.
Does anyone know of a free addin which will add this functionality?
If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.
There is an add-in for Visual Studio that will do something similar called RockScroll.
When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.
I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.
I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.
Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.
The RockScroll Addin is not available for Visual Studio 2010 and above.
As a replacement, the free "Highlight all occurrences of selected word" plugin will highlight all occurences of the selected string after a doubleclick. There is no delay as with the native vs2010 highlighter.
It is string-based, which means it works inside comments and string literals.
Microsoft published a tool that sort of does what you want.
Some of my favourite features:
Enhanced Scrollbar
Auto Brace Completion
Ctrl + Click Go To Definition
Open Containing Folder
and the list goes on.
For Visual Studio 2010 and for Visual Studio 2012

In Visual Studio 2008, how can I make control+click do a "Go To Definition"?

In the Delphi IDE, you can hold control and click on a method to jump to its definition. In VS2008, you have to right-click and select "Go To Definition".
I use this function quite often, so I'd really like to get VS to behave like Delphi in this regard - its so much quicker to ctrl+click.
I don't think there's a way to get this working in base VS2008 - am I wrong? Or maybe there's a plugin I could use?
Edit: Click then F12 does work - but isn't really a good solution for me.. It's still way slower than ctrl+click.
I might try AutoHotkey, since I'm already running it for something else.
Edit: AutoHotkey worked for me. Here's my script:
SetTitleMatchMode RegEx
#IfWinActive, .* - Microsoft Visual Studio
^LButton::Send {click}{f12}
Not for Visual Studio 2008, but if you upgrade to Visual Studio 2010, you can use the free
Visual Studio 2010 Pro Power Tools from Microsoft to achieve this.
You could create an Autohotkey script that does that. When you ctrl-click a word, send a doubleclick then a F12.
I don't have AHK handy so I can't try and sketch some code but it should be pretty easy; the AHK recorder should have enough features to let you create it in a point 'n' click fashion and IIRC it is smart enough to let you limit this behaviour to windows of a certain class only.
When you have your script ready just run the script in the background while you code. It takes just an icon in the Notify bar.
Visual Studio 2008 defaults this to F12, but you can set it in Tools | Options | Environment | Keyboard, and change Edit.GoToDefinition - however, I'm not sure how you can get it to CTRL+mouseclick.
Resharper does that but it's not free.
Highly recommended plugin though, most experienced .NET developers use it.
Just a quick note that the following AutoHotkey script works for me in Visual C++ 2010 Express.
SetTitleMatchMode 2
#IfWinActive, Microsoft Visual C++ 2010 Express
^LButton::Send {click}{f12}
I also changed the shortcuts for View.NavigateForward and View.NavigateBackward to Alt+Right/Left Arrow since I am used to Eclipse.
Yes, both Resharper (a must have!) and Productivity Power Tools have this feature.
Interesting quirk, though.
If you just go with the defaults on both tools (if you install both tools) you can experience a frequent double-jump problem (jump to definition from where you first click and then jump again from what your cursor is above upon getting to that first definition) until you turn off one of the Ctrl-Click features of these add-ons.
Put the mouse cursor on the method name or any identifier, and press F12

Resources