如何用非文本信息扩充Visual Studio C#编辑器? [英] How to augment the Visual Studio C# editor with non-textual information?

查看:112
本文介绍了如何用非文本信息扩充Visual Studio C#编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到过Visual Studio C#编辑器显示额外的UI和/或数据的情况:

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


  • 引入了调试器断点配置在VS 2015中-请参见此处

  • Ozcode

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

我想做类似的事情,但不知道哪个Visual Studio使用的API。我遇到过这些Visual Studio可扩展性技术:

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:


  • 调试器可视化器:允许使用C#编写自定义可视化器,但似乎要求输出位于模式弹出对话框中。因此,这似乎不是正确的框架。

  • 投影缓冲区:似乎很有希望,但不确定是否可以将其用于增强主编辑器窗口,而不是创建完全自定义的窗口编辑器窗口。

  • 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.

所以问题是,我该如何编写在调试时将自定义调试信息添加到Visual Studio编辑器的代码?

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

推荐答案

查看 Editor Text Adornment (编辑器文本修饰符),该操作相对于单个字符和文本在文本中添加WPF视觉效果编辑器视口装饰,可将UI添加到文本编辑器本身。

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.

有关示例,请参见文本内装饰示例键入速度表示例

这篇关于如何用非文本信息扩充Visual Studio C#编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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