Override visual studio syntax highlighting through a plug-in?

£可爱£侵袭症+ 提交于 2019-12-11 03:48:40

问题


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?

Thanks!


回答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.

If you want to write your own....

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

The interface you'll need to work with is IVsColorizer2 (or 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.




回答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.

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



来源:https://stackoverflow.com/questions/807639/override-visual-studio-syntax-highlighting-through-a-plug-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!