Resharper - is it possible to go to method's implementation on CTRL-click instead of going to declaration?
Asked Answered
C

5

52

if I do CTRL-click on method's name in VS2012 with Resharper 8, I'm redirected to the method's "declaration" - and that's quite inconvenient if I have lots of interfaces in my project.

If it possible to configure resharper to go right to the IMPLEMENTATIONS of the method (and if there is more than one - display a context menu which I need to select the desired method from)? I can achieve this if I do right-click -> "Go to Implementation" but I really prefer to have this on ctrl-click.

Copse answered 29/11, 2013 at 23:34 Comment(3)
I just "Go to definition" then press Alt + End on the interface. It takes you to its implementation. Extra key press.. but not too bad.Mccrea
See my answer to the same question here: #20180498Graz
Alt + F12 = Peek Definition, then ALT + End = Peek ImplementationStevestevedore
B
90

CTRL+Click = Go to declaration

CTRL+ALT+Click = Go to implementation

CTRL+SHIFT+Click = Peek to declaration (Visual Studio 2013)

Biel answered 30/1, 2014 at 15:53 Comment(2)
Is there an alternative to that mouse click?Certifiable
ctrl+alt+click does goto implementation, but it opens it in a new pane. WHYYYYY?? Can I turn off that new pane and just have a normal tab?Ruminant
M
7

I don't think you can re-assign the CTRL+LeftClick Option. Per their documentation.

By default, Go To Declaration is available by Ctrl + left-click. To change the default behavior, use controls on the Search & Navigation page of the Options dialog box. For more information, see ReSharper Options: Environment: Search & Navigation

Since it says "change", I went and checked the Search & Navigation section mentioned above to verify if this behavior can indeed be changed. But the change is simply a Checkbox that says.

Go To Declaration on <Control + Left Click> in editor.

I unchecked this option and saved it, and now, I get nothing if I CTRL+Left Click a method name. So I think you can only disable or enable this option, not re-assign the keys.

Mack answered 30/11, 2013 at 0:6 Comment(0)
M
5

Keyboard only options:

CTRL+F12 OR ALT+END = Go to implementation

F12 = Go to declaration

ALT+F12 = Peek declaration

Merell answered 6/4, 2016 at 13:31 Comment(0)
C
2

There are 2 solutions for it:

  1. CTRL + ALT + Left Click - default behaviour
  2. VS: Tools => Option => Environment => keyboard => Search "ReSharper.ReSharper_GotoImplementation" and then assign the key you want.
Chesty answered 24/2, 2015 at 6:32 Comment(0)
R
1
  1. install MiddleClickDefinition extention by norachuga
  2. restart VS
  3. ctrl+middleclick and enjoy!

worked in my VS2022

Relive answered 23/11, 2023 at 13:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.