26

I would like to have a quick keyboard shortcut to turn on/off this feature. The feature is useful, but sometimes I want to look only at code and this feature distorts the code visual appearance.

I have bound EditorContextMenus.CodeLens.CodeLensOptions to a keyboard shortcut, but this is too slow because the Options menu takes too long to open. I would really like to have shortcut that toggles this feature on and off.

How can I do this? Did I miss some option in Environment->Keyboard or is there some add-on that can help?

4

2 回答 2

21

要自动化“选项”对话框,您可以在Visual Commander中创建以下命令并为其分配键盘快捷键:

DTE.ExecuteCommand("EditorContextMenus.CodeLens.CodeLensOptions")
System.Windows.Forms.SendKeys.Send("{TAB} {ENTER}")
于 2015-08-01T08:32:31.847 回答
8

有趣的。Codelens 已经有一些与之相关的键绑定。如果您按下 ALT,它会在指示器上显示数字(参考、源代码控制、测试),但据我所知,没有一个可以打开/关闭指示器。我将接受此反馈并为在 Microsoft 拥有 codelens UI 的团队提交错误。

于 2015-10-16T17:57:04.873 回答