How to augment the Visual Studio C# editor with non-textual information?

◇◆丶佛笑我妖孽 提交于 2019-12-07 19:51:15

问题


I've come across cases where the Visual Studio C# editor displays extra UI and/or data:

  • The debugger breakpoints configuration introduced in VS 2015 - see here.
  • Ozcode, which augments the editor with debug-time values.

I'd like to do something similar, but don't know which Visual Studio APIs to use. I've come across these Visual Studio extensibility technologies:

  • Debugger Visualizers: allows a custom visualizer to be written in C#, but seems to require the output to be in a modal pop-up dialog. Therefore this does not seem to be the right framework.
  • Projection Buffers: Seems promising but not sure if this is can be used to augment the primary editor window, as opposed to creating an entirely custom editor window.

So the question is, how can I write code that adds custom debug information to a Visual Studio editor at debug time?


回答1:


Look at Editor Text Adornment that adds WPF visuals within the text, relative to individual characters and Editor Viewport Adornment that adds UI to the text editor itself.

For examples see Intra-Text Adornment Sample and Typing Speed Meter Sample.



来源:https://stackoverflow.com/questions/38958099/how-to-augment-the-visual-studio-c-sharp-editor-with-non-textual-information

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