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

RCS1213: annoying Quick Action menu item placement when renaming #305

Closed
wiz0u opened this issue Mar 14, 2018 · 4 comments
Closed

RCS1213: annoying Quick Action menu item placement when renaming #305

wiz0u opened this issue Mar 14, 2018 · 4 comments

Comments

@wiz0u
Copy link

wiz0u commented Mar 14, 2018

After renaming a method (by changing its name in its implementation), I usually type Ctrl-. (Quick Actions and Refactorings) and validate with Enter to apply the renaming throughout my code.

However, with RCS1213 enabled, the first entry in the Quick Actions menu becomes the "Remove method X" from RCS1213 because it detects the method is not used (with the new name).
So a quick validation with Enter triggers the wrong actions.

I'm thinking about 2 different ways to fix this:

  • If you can control the placement of the action in the context menu, maybe you could move it further down so the first action remains "Rename X to Y"
  • Eventually, there might be a way to let the user choose to keep RCS1213 enabled (for the Error List to display the issue) but disable its associated action in the Quick Actions menu (that feature request might apply to other RCS* too)
@josefpihrt
Copy link
Collaborator

When I tried to test this issue "rename" item always showed above "remove" item. I don't know what causes the different ordering on your system.

To your points:

  1. Currently it is not supported by Roslyn library to manage order of items in the menu.
  2. Currently it is not supported by Roslyn library to disable a code fix for a certain diagnostic (although it could be useful in this case).

Your options are:

  1. Click down arrow before you click enter.
  2. Use F2 to rename an identifier.
  3. Disable RCS1213.

@wiz0u
Copy link
Author

wiz0u commented Mar 19, 2018

Ok.

I'm under VS2015. Renaming through F2 crashes often (dotnet/roslyn#7364)
image

Hopefully we will migrate to VS2017 soon.

@wiz0u
Copy link
Author

wiz0u commented Mar 26, 2018

I'm now under VS2017. Quick action Remove (RCS1213) still appears first, above the Rename (native) quick action.

@josefpihrt
Copy link
Collaborator

If you are under 2017 my recommendation is to use F2 to rename identifiers.

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

2 participants