I'm a Java developer starting with .Net development using VS.Net 2008. I would love to get the Eclipse style of navigating methods etc by pressing the Ctrl key, hover over a method then click it to got to that method's declaration. Does such a plugin exist for VS.Net 2008?
thanks
To summarize In Visual Studio 2008, how can I make control+click do a “Go To Definition”?, you could either use AutoHotKey with the following script,
SetTitleMatchMode RegEx
#IfWinActive, .* - Microsoft Visual Studio
^LButton::Send {click}{f12}
or use ReSharper.
Two ways to go to a method's declaration:
Press F12 when the cursor is positioned in a call to the method.
Right click a call to the method and select 'Go To Definition' on the popup menu.
Related
A keyboard shortcut that I've used frequently going back several Visual Studio versions is Ctrl+Shift+8 to go back to where I was, after doing a F12 to Go To Definition.
In Visual Studio 2015, pressing Ctrl+Shift+8 doesn't seem to do anything.
Opening up Visual Studio 2013 and looking at the Tools | Customize | Keyboard dialog, Ctrl+Shift+8 is mapped to the command View.PopBrowseContext. In Visual Studio 2015, Ctrl+Shift+8 has that same command mapping, but the command doesn't seem to work.
Is there a way to get the View.PopBrowseContext command to navigate back after doing a Go To Definition (F12) in Visual Studio 2015?
Visual Studio 2015 Connect -> View.PopBrowseContext command and others doesn't work (issue removed from Connect site by Microsoft)
Issue on GitHub -> Bring back Go to Definition Navigation Stack #14496
View.NavigateBackward (Ctrl+-) is not good replacement for View.PopBrowseContext (Ctrl+Shift+8). If you invoke Edit.GoToDefinition (F12) and then click a few times with the mouse moving the cursor around, all those moves are recorder in the navigation stack.
View.PopBrowseContext (Ctrl+Shift+8) redirects directly to the previous definition (the place that you invoked Edit.GoToDefinition (F12) last).
View.PopBrowseContext
Edit.GoToReference
View.BrowseNext
View.BrowsePrevious
Edit.GoToDeclaration
View.ForwardBrowseContext
Note: these commands were broken in Visual Studio 2015. Still do not work in Visual Studio 2017.
A workaround in Visual Studio 2015 is to press CTRL+- instead (mapped to the View.NavigateBackward command) to go back after a F12 press, instead of trying to use View.PopBrowseContext / Ctrl+Shift+8. (Reference)
When you first start Visual Studio, it offers you a choice of typical usage (not sure how it's called exactly): C++, C#, etc. I believe the initial keyboard binding depends on that choice.
I used FeinCtrl and noticed that View.PopBrowseContext is mapped to Ctrl+Num *, and it works just fine. The Ctrl+Shift+8 is mapped to Edit.ViewWhiteSpace for me...
Do you by chance have a conflict, when another command in a different scope is papped to the same shortcut keys?
I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context menu.
Where did it go? How do I get it back?
Your suggestion cannot include menu Edit → Refactor.
I have tried to reset my Visual Studio settings back to default using menu Tools → Import and Export Settings and that didn't bring the menu back either.
Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.
Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:
Right click
Quick actions
Click extract Method
I think they've changed it to feel more "ReSharper"ey. All of the functionality should still be there however.
Here's more information on refactoring in Visual Studio 2015 - hopefully this helps! Refactoring (C#)
You no longer need to access the refactoring using the mouse right click.
It is recommended that you use the keyboard shortcut keys within Visual Studio.
For all possible shortcut keys, see Default Keyboard Shortcuts in Visual Studio, Refactor.
You might need to build the project to get it to work.
See Code Editing ASP.NET Web Forms in Visual Studio 2013 | Microsoft Docs. (If it is missing then the point is that I am using an example provided by Microsoft.). In Refactoring and Renaming see To extract a method in a C# page. When I follow the instructions I cannot find the feature to extract the code to a method. When I tried the Edit menu it said I did not have valid code. Then I built the project and the feature to extract the code was available and worked.
If you change the name of the object you are refactoring, the light bulb then appears to the left which asks if you wish to change the name of the object (i.e. refactor) or generate a new constructor for the new named object.
Ctrl + . is the shortcut key for extracting a method in Visual Studio 2015 and onward.
Ctrl+M, R does not work anymore in new versions.
This question relates to this ReSharper YouTrack issue.
In Visual Studio 2010 with ReSharper 7.1.1 installed, if I go to Tools > Options > Environment > Keyboard, there is a command called ReSharper_SilentCleanupCode.
I would like to bind this command to a toolbar button.
This seems to be impossible using Tools > Customize > Commands because the only commands available within this dialog are for actions that already have an associated menu item. The particular ReSharper command I'm interested in (Silent Code Cleanup) doesn't appear in any menu, so it cannot be assigned to a toolbar button using the "GUI".
Is there any other way to bind a keyboard-only command to a toolbar button? (One of ReSharper's programmers thought the "VS script editor" could be used, but I'm not having any luck finding info on this.)
Edit
I should have mentioned this in the first place. While azhrei's macro solution is great for Visual Studio 2010, it will break once I upgrade to VS 2012, because macros are no longer supported. If someone has a solution that will continue to work in VS 2012, that would be preferable. (Or perhaps VS 2012 toolbars don't have the same limitation in the first place?)
Add a macro that executes the command, then add the macro to a toolbar.
This works because it makes the keyboard-only command appear in the Macros menu in the Customize Commands dialog.
Details
Add a macro which does this:
Sub _ReSharper_SilentCleanupCode()
DTE.ExecuteCommand("ReSharper_SilentCleanupCode")
End Sub
Put this macro in a module which appears in Customize..Commands..AddCommand..Categories..Macros, such as Samples or MyMacros.RecordingModule, but not MyMacros.Module1 (the default when using the macro IDE).
Go to Tools..Customize..Command and select the Toolbar you want.
Now Add Command... and select the Macros category.
Select your Macros.Samples._ReSharper_SilentCleanupCode macro.
Click Modify Selection and change the name to #-) or whatever text makes you think ReSharper Silent Code Cleanup without being too long for your toolbar. :-)
I tried this with Visual Studio 2010 and ReSharper 7.1.2.
Edit
Visual Commander is a apparently way to get this going on VS2012 as well - see comments below for more.
The title pretty much explains the whole question. I'm using Visual Studio 2010 Premium, I like the Navigate Backward command for when I right click on something and do go to definition and then I want to go back to where I was Navigate Backward works. But I'm so used to my mouse button button doing that, I've noticed I've starting using it in Visual Studio and expecting it to go back but it doesn't. I know how to change the command to a different key press, but is there a way to make it work on a mouse button?
This seems to be a (pointless) Limitation of the C++ IDE in Visual Studio. In C# the mouse buttons work as expected, but not in C++.
There are several Addins for Visual Studio to cover this functionality, I'll point you to the one that I found in this answer:
http://www.codeproject.com/Articles/57119/Forward-Backward-Code-Navigation-with-the-Mouse-Th
This Add-In worked for me. I could also upgrade it to Visual Studio 2012 by simply changing the Version-Tag in the Addin-file to "11.0".
I moved from Visual Studio 2008 to Visual Studio 2010.
My code snippets work good in Visual Studio 2010 on the start of a line, but not when adding parameters to a methodcall. This did work in Visual Studio 2008.
So when i type this : "DoSomeMethod([nowiwantmycodennippets!]", the code snippets are not in the intellisense list.
Does anyone know if this is a setting, or just not working anymore, and if it can be fixed?
This appears to be bug. If you type your snippet name (i.e. noiwantmycodesnippets) and press ESC to dismiss the completion list (if open), then you can press Tab to insert your code snippet. So it's just a matter of the code snippets missing from the completion list.
You can use the Control+K, Control+X key chord to show the code snippets' list also. But this isn't as nice as using it through the completion list.
Are you using ReSharper? If so, Resharper Intellisense overwrites the VS default one, so that i.e. code snippets do no appear in the completions. Try turning off ReSharper Intellisense in the ReSharper Options (Environment->Intellisense->General, choose Visual Studio).
If ReSharper Intellisense is a must, you'll have to create a ReSharper "Live Template" which opens up for "code snippets" behaviour, only ReSharper is way more advanced -- see for example this one http://www.brianlow.com/index.php/2009/04/06/resharper-live-templates-for-nunit/.
On my machine I just type "public void Test(" and than ctrl+space and type the name of my snippet. Works like a charm. I've got the C# keyboard shortcuts, I think.