Skip to content

GoToImplementation with ctrl + click via a VS Extension. #29

Open
@rollsch

Description

@rollsch

Hi @sharwell , I didn't know how else to contact you but I thought you may be able to assist as you have been very helpful in the past.

I want to write a Visual Studio extension similar to your mouse extension. I want to override ctrl + click to execute "GoToImplementation" instead of "GoToDec"

I can only find the following commands in VSConstants.cs
GotoDefn : Go to Definition
GotoDecl: Go to Declaration

GoToImplementation is no where to be found as it appears to be some kind of extension (as it shows a drop down menu instead).

After some digging I have found
GoToImplementationCommandArgs and GoToImplementationCommandHandler however I cannot find any source code or example of how to manually execute this in a manor similar to how you do it here:

cmdId = (uint)VSConstants.VSStd97CmdID.ShellNavForward;
...
 IVsUIShell shell = (IVsUIShell)ServiceProvider.GetService(typeof(SVsUIShell));
Guid cmdGroup = VSConstants.GUID_VSStandardCommandSet97;
OLECMDEXECOPT cmdExecOpt = OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER;
object obj = null;
ErrorHandler.ThrowOnFailure(shell.PostExecCommand(cmdGroup, cmdId, (uint)cmdExecOpt, ref obj));
e.Handled = true;

I appreciate you are busy and this is not the best place to ask, however could you assist pointing me in the right direction? I would like to publish this as an extension to help the community as it has been requested many times.

https://resharper-support.jetbrains.com/hc/en-us/community/posts/115000490890-Why-doesn-t-ctrl-left-click-go-straight-to-implementation-instead-of-interface-definition-

Thank you for your time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions