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

喜你入骨 提交于 2019-12-18 10:59:11

问题


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.


回答1:


CTRL+Click = Go to declaration

CTRL+ALT+Click = Go to implementation

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




回答2:


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.




回答3:


Keyboard only options:

CTRL+F12 OR ALT+END = Go to implementation

F12 = Go to declaration

ALT+F12 = Peek declaration




回答4:


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.


来源:https://stackoverflow.com/questions/20294749/resharper-is-it-possible-to-go-to-methods-implementation-on-ctrl-click-instea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!