Resharper中的重新排列代码快捷方式在VS2015中不起作用 [英] Rearrange Code shortcut in Resharper doesn't work in VS2015

查看:118
本文介绍了Resharper中的重新排列代码快捷方式在VS2015中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用快捷方式向上/向下移动行时( Ctrl + Alt + Shift + /),它会突出显示代码并显示工具提示消息使用上/下移动文本行",但没有任何反应.但是,如果我通过菜单栏(Resharper> Edit> Rerangerange Code> Move Up)尝试相同的命令,它将按预期方式移动选定的行.

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.

我曾经一直使用此功能,所以我发现此错误非常烦人.显然,其他人也遇到了这种情况(请参阅 Resharper上下移动的行不起作用),但我无法为其找到解决方案.重置键盘布局和重新应用VS键盘方案不起作用.

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.

有人能解决此问题吗?

推荐答案

此问题的原因(当您通过远程桌面使用VS和Resharper登录到计算机时)是Ctrl-Alt-左箭头/Ctrl-Alt-右箭头组合没有发送到您的虚拟机

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

有两种解决方法:

  1. 我的第一个灵魂(更改组合请参见下文)

  1. My first soultion (change combination see below)

您可以按照线程中的说明使用AutoHotKey脚本: https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-mote-p

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

修正为

我描述了_MoveRight快捷方式的过程-其他快捷方式的工作原理相同

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

第1步检查是否有冲突的更改

seeImage

  • 转到工具->选项->键盘

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

在显示包含以下内容的命令"字段中找到您的命令(示例中为司法权)

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

在按快捷键"字段中单击,按ALT +右箭头

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

会发现有冲突的快捷方式- Edit.CompleteWord ...

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

步骤2现在,我们需要删除此快捷方式

  • 在显示包含的命令"字段中写Edit.CompleteWord

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

您应该在所选命令的快捷方式"字段中看到ALT +右箭头快捷方式

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

单击删除"按钮

步骤3现在,我们需要将快捷方式添加到_MoveRight函数

  • 在显示包含以下内容的命令"字段中找到您的命令(示例中为司法权)

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

在按快捷键"字段中单击,按ALT +右箭头

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

单击分配"

这篇关于Resharper中的重新排列代码快捷方式在VS2015中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆