通过插件覆盖 Visual Studio 语法突出显示?

问题描述:

这与我之前问过的这个问题有关关于语法突出显示用户定义的代码块.

This is related to this question I asked earlier about syntax highlighting user-defined blocks of code.

是否可以为 Visual Studio 编写某种插件来覆盖它的语法突出显示方式?我该从哪里开始寻找?

Is it possible to write some kind of plug-in for visual studio where it would override how it does syntax highlighting? Where would I start looking for that?

谢谢!

这是可能的.许多 VS 插件,例如 Visual Assist、Resharper、Code Rush 等,都对 Visual Studio 中的语法突出显示的工作方式有自己的扩展.

This is possible. Many VS addins, such as Visual Assist, Resharper, Code Rush, etc. have their own extensions to how the syntax highlighting in Visual Studio works.

如果你想自己写......

If you want to write your own....

查看关于语法着色的页面VSX 参考文档.

Take a look at the page on Syntax Coloring in the VSX reference documentation.

您需要使用的界面是 IVsColorizer2(或 IVsColorizer).

The interface you'll need to work with is IVsColorizer2 (or IVsColorizer).