Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"gd" doesn't work correctly with ReSharper 10's "Usage-aware Go to Declaration" #1696

Open
ljani opened this issue Nov 9, 2015 · 3 comments

Comments

@ljani
Copy link

ljani commented Nov 9, 2015

Steps:

  1. Install ReSharper 10 on VS2015
  2. In ReSharper's options, enable Smart go to declaration (ReSharper > Options > Environment > Search & Navigation > Enable 'Smart go to declaration')
  3. Move your cursor over a symbol usage (eg. new Symbol())
  4. Press gd

Actual output:

  1. Cursor is moved to the declaration and then instantly to the first usage of that symbol

Expected output:

  1. Cursor is moved to the declaration (in case of new Symbol() it should be moved to the constructor of Symbol)
  2. Subsequent gds move the cursor to the next usage

Workarounds:

  • Turn off Smart go to declaration, see above

See also:
#1643

http://blog.jetbrains.com/dotnet/2015/11/02/welcome-resharper-ultimate-10-rtm/

Usage-aware Go to Declaration. ReSharper 10 extends the functionality of Go to declaration (as well as Ctrl+click) so that you can also use the shortcut to look up for usages. In case you have one declaration and one usage, you can use Go to declaration to simply switch between them. If you have multiple usage of a symbol, subsequent Go to declaration hits will take you to further found usages of the symbol, one usage at a time. Navigation between usages is aided by a Find Usages-like pane that enumerates found usages, contains additional controls to mouse-click between usages, and helps you flush all found usages to the regular Find Results window if you like.

@mattrrichard
Copy link
Contributor

Could this be solved by adding an entry to your vsvimrc to remap gd explicitly to the Resharper command?

Something like this:

nnoremap gd :vsc ReSharper.ReSharper_GotoDeclaration<CR>

(I don't have Resharper 10 to see if there is a new command you should map to instead of GotoDeclaration so you may have to play with that bit)

@pescuma
Copy link

pescuma commented Jan 6, 2016

I had this problem too. Adding a explicit mapping to resharper command fixes the problem.

@shmup
Copy link

shmup commented Oct 3, 2016

@mattrrichard had the right idea. Worked like a charm.

@jaredpar jaredpar added the bug label Jan 12, 2018
@jaredpar jaredpar added this to the Unscheduled milestone Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants