通过插件覆盖visual studio语法高亮显示?

时间:2022-04-04 05:35:54

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

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

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?

是否有可能为visual studio编写某种插件,它会覆盖语法突出显示的方式?我会从哪里开始寻找呢?

Thanks!

3 个解决方案

#1


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.

这个有可能。许多VS插件,如Visual Assist,Resharper,Code Rush等都有自己的扩展,以解决Visual Studio中语法高亮的问题。

If you want to write your own....

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

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

请查看VSX参考文档中的语法着色页面。

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

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

#2


Obviously this is possible since Visual Assist does it.
But I wouldn't really know where to look for how to go about doing it. Maybe you can try poking inside Visual Assist and see which calls its making.

显然这是可能的,因为Visual Assist可以做到这一点。但我真的不知道在哪里寻找如何去做。也许你可以尝试在Visual Assist中查看并查看它正在制作的调用。

#3


If you really need it today I would recommend CodeRush/DXCode which you can get a free version of. If you ask in their community forums they are usually very helpful about pointing you in the right direction.

如果您今天真的需要它,我会推荐CodeRush / DXCode,您可以获得免费版本。如果您在他们的社区论坛中询问,他们通常会非常乐于帮助您指明正确的方向。

If you can wait it is supposed to be super easy to do this sort of think in Visual Studio X

如果你可以等待它应该是非常容易在Visual Studio X中做这种思考

#1


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.

这个有可能。许多VS插件,如Visual Assist,Resharper,Code Rush等都有自己的扩展,以解决Visual Studio中语法高亮的问题。

If you want to write your own....

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

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

请查看VSX参考文档中的语法着色页面。

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

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

#2


Obviously this is possible since Visual Assist does it.
But I wouldn't really know where to look for how to go about doing it. Maybe you can try poking inside Visual Assist and see which calls its making.

显然这是可能的,因为Visual Assist可以做到这一点。但我真的不知道在哪里寻找如何去做。也许你可以尝试在Visual Assist中查看并查看它正在制作的调用。

#3


If you really need it today I would recommend CodeRush/DXCode which you can get a free version of. If you ask in their community forums they are usually very helpful about pointing you in the right direction.

如果您今天真的需要它,我会推荐CodeRush / DXCode,您可以获得免费版本。如果您在他们的社区论坛中询问,他们通常会非常乐于帮助您指明正确的方向。

If you can wait it is supposed to be super easy to do this sort of think in Visual Studio X

如果你可以等待它应该是非常容易在Visual Studio X中做这种思考