Visual Studio 2015 - CodeLens 使用键盘快捷键打开/关闭 [英] Visual Studio 2015 - CodeLens toggle on/off with keyboard shortcut

查看:40
本文介绍了Visual Studio 2015 - CodeLens 使用键盘快捷键打开/关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个快速的键盘快捷键来打开/关闭此功能.该功能很有用,但有时我只想看代码,而此功能会扭曲代码的视觉外观.

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.

我已将 EditorContextMenus.CodeLens.CodeLensOptions 绑定到键盘快捷键,但这太慢了,因为选项"菜单需要很长时间才能打开.我真的很想拥有打开和关闭此功能的快捷方式.

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.

我该怎么做?我是否错过了 Environment->Keyboard 中的某些选项,或者是否有一些可以提供帮助的附加组件?

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

推荐答案

要自动化选项对话框,您可以在 Visual Commander 并为其分配键盘快捷键:

To automate the Options dialog, you can create the following command in Visual Commander and assign a keyboard shortcut to it:

DTE.ExecuteCommand("EditorContextMenus.CodeLens.CodeLensOptions")
System.Windows.Forms.SendKeys.Send("{TAB} {ENTER}")

这篇关于Visual Studio 2015 - CodeLens 使用键盘快捷键打开/关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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