Rearrange Code shortcut in Resharper doesn't work in VS2015

纵然是瞬间 提交于 2019-12-09 18:38:03

问题


When I try to use the shortcut for moving lines up/down (Ctrl+Alt+Shift+/), it highlights the code and shows the tooltip message "Use Up/Down to move text line" but nothing happens. If however I try the same command via the menu bar (Resharper > Edit > Rearrange Code > Move Up) it moves the selected lines as expected.

I used to use this feature all the time so I find this bug very annoying. Apparantly, others also experience this (see comments for Resharper move line up down not working) but I haven't been able to find a solution for it. Resetting keyboard layouts and reapplying VS keyboard schemes doesn't work.

Has anyone been able to resolve this issue?


回答1:


[EDIT]

Reason of this is issue (when you are logging to machine with VS and Resharper via Remote Desktop) is that Ctrl-Alt-Left Arrow/Ctrl-Alt-Right Arrow combinations are not sent to your virtual machine

There are two workarounds:

  1. My first soultion (change combination see below)

  2. You can use AutoHotKey script as stated in thread: https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-remote-p

[/EDIT]

Reason is duplication of the same hotkeys which could be found in 'Shortcut currently used by:' combobox

Fix is

I described process for _MoveRight shortcut - for other shortcuts it works the same

STEP 1 Check for conflicting changes

seeImage

  • go to Tool --> Options --> Keyboard

  • in field 'Show commands containing' find your command (moveright in example)

  • click in field 'Press shortcut keys' press ALT + RIGHT ARROW

  • in field Shortcut currently used by you will find conflicting shortcut - Edit.CompleteWord...

STEP 2 Now we need to delete this shortcut

  • in field 'Show commands containing' write Edit.CompleteWord

  • you should see ALT + RIGHT ARROW shortcut in field 'Shortcuts for selected command

  • click Remove button

STEP 3 Now we need to add our shortcut to _MoveRight function

  • in field 'Show commands containing' find your command (moveright in example)

  • click in field 'Press shortcut keys' press ALT + RIGHT ARROW

  • click Assign



来源:https://stackoverflow.com/questions/38715446/rearrange-code-shortcut-in-resharper-doesnt-work-in-vs2015

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