I want to build a Visual Studio 2017 extension that will help me automate a task. It will be available in the context menu (right click menu) of the code pane.
For that I need to recognize the method the cursor is pointing to, it's class, namespace and parameters. The documentation for doing that seems scarce.
Can anyone help me get in the right path to do this?
Thanks.
Related
I am using Visual Studio 2010 Shell and I have had to change my ProtectionLevel to 'DontSaveSensitive' mid project.
Now I get an error: Basic Checks.dtsx has a different ProtectionLevel than the project.
However, there is nowhere in the Project properties that I can see where the ProtectionLevel can be changed to match. All searches seem to indicate this is easy in VS 2012 but can't find any info for VS 2010
Any help would be greatly appreciated!
thanks
Ravi
You have two different places where you can set ProtectionLevel.
First place is properties pane of a package, second place is properties pane of entire project (right click on a project and you will find it under Common Properties). Ensure that you have the same setting in both places.
The Context Window is a Source Insight innovation that automatically provides relevant information while you are viewing and editing your source code. I've searched on the web and found a Vim plugin SrcExpl providing the same function in Vim. So, is there a way to config Visual Studio with a Context Window as in Source Insight?
In Visual Studio there is a Code Definition Window that you can open from the main View menu.
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.
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.
Please let me know how to add an action into the context-menu of "Solution Explorer" in Visual Studio?
I'd like to add my action into the context-menu of files listed in this explorer (see a screenshot for example), and then be able to launch my application (EXE file) that can get the filename (including its path) as an argument.
I currently use VS2008, however please let me know if that should be different with VS2010 and VS2012.
THANK YOU
Write your own visual studio Add-In take a look at that link this is good place to start. but its not easy...
You're going to have to write a Visual Studio Add-In.
Take a look at the code for the Xsd2Code addin on codeplex. Specifically the Connect class. This addin does something similar to what you want... it adds a context menu option that's available when you right-click on project items (in this case, only enabled for .xsd files).
Also, check out the Solution Explorer Context Menu sample within the Visual Studio 2005 Automation Samples download.