Resharper move line up down not working

房东的猫 提交于 2019-11-28 18:18:48

问题


I can't make it working, move line up or down doesn't work. When I reset keyboard for VS and applay scheme for Resharper it ask me for this :

and if I take first selection , then alt + up switch me between methods, if I use second selection then this combination does not effects.


回答1:


Alt+Up is not a ReSharper shortcut to move a line. It most likely belongs to the Productivity Power Tools extension, that has a feature to move one or more (selected) lines.

Personally, I don't like this feature in PPT, since it will just move the line(s), regardless of their scope, causing compilation errors. I much rather use ReSharper's feature of moving blocks of code up or down, by pressing Ctrl + Shift + Alt + / or / - when on the beginning of the line, it will move the entire line or block of code, but can also be used to move entire methods, change the order of parameters, etc.




回答2:


I ended up resetting my Resharper shortcuts. Then when prompted with the dialog, chose Use Visual Studio Commands for the Alt+Up & Alt+Down shortcut.

You could also set this manually in Tools > Options > Keyboard. Search for "MoveSelectedLines" and then assign Alt+Up/Down to the appropriate command.




回答3:


On my machine with Resharper 2016.1 it makes a difference on what position the cursor is located:

  • cursor located from 1st to last character on the line: the shortcuts work as described by Igal Tabachnik
  • cursor located on white spaces before 1st characters of the line the shortcuts are ignored.

Regards Bernhard



来源:https://stackoverflow.com/questions/22673875/resharper-move-line-up-down-not-working

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