How to find all available actions at current position for a plug-in

I’m building a Visual Studio extension to enable voice control for ReSharper features. This will apply to code/C# files only.

I can use the EnvDTE.Command types for the execution of the actual command, but I need to find out which commands are available for the current position within the code.  As a first step it would be nice to have the ability to determine which commands are available the same way the ReSharper->Refactor menu works.


Is there a way to programmatically get this information?


1 comment
Comment actions Permalink
The commands in the menu are just standard Visual Studio commands, so you should be able to use the standard IOleCommandTarget.QueryStatus and Exec. Internally, ReSharper has a similar construct with it's ActionManager, where each command implements an action and has similar IsAvailable and Execute methods.

Please sign in to leave a comment.