使用 ReSharper 的“删除未访问的字段”后进行导航快速修复
当使用 ReSharper 上下文菜单中的“删除未访问的字段”快速修复选项时,它会突出显示受影响的行。
是否有键盘快捷键可以将我带到突出显示的行? (通常该行也是多余的,也可以删除)
例如。给定以下代码:
public class Sample
{
private string unusedField;
public Sample()
{
unusedField = new string('a', 4);
}
}
在“unusedField”字段上使用“删除未访问的字段”快速修复,突出显示构造函数中的行(看到该行已更新)。编辑插入符号位于字段声明所在的行附近。
When using the 'Remove not accessed field' quick fix option from the ReSharper context menu, it highlights the affected line.
Is there a keyboard shortcut that will take me to that highlighted line? (As often that line is also redundant and can be removed too)
eg. Given this code:
public class Sample
{
private string unusedField;
public Sample()
{
unusedField = new string('a', 4);
}
}
Using the 'Remove not accessed field' quickfix on the 'unusedField' field, highlights the line in the constructor (seeing as that line is updated). The editing caret stays near the line where the field declaration was.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
利用该字段突出显示为搜索结果这一事实,您可以使用
ReSharper
|查找
|Next Item
(对我来说(我认为)默认的 VS 键绑定是 Ctrl+Alt+PgDn)去那里。到达那里后,您可以 Ctrl+Shift+L 删除该行(VS 快捷方式),或 End 然后 Alt+Enter 和
引入变量
(R#)。Using the fact that it's highlighted as a search result the former site of usage of a field, you can use
ReSharper
|Find
|Next Item
(which for me using (I think) the default VS keybindings is Ctrl+Alt+PgDn) to go there.Once there, you could maybe Ctrl+Shift+L to delete the line (a VS shortcut), or End then Alt+Enter and
Introduce variable
(R#).