如何在 Visual Studio 中自定义代码的文本编辑器或颜色标签部分?
如何自定义、扩展代码的文本编辑器或颜色标记部分?
我希望 Visual Studio 对我的代码部分进行颜色编码。我可以使用
#region
并为其指定颜色吗?有什么办法可以让两个括号之间的背景颜色不同吗? (我希望每个代码“块”都有自己的颜色。)
我看过 这里了解一些见解,但它们都是基于“您选择的”来实现的。我想要的只是让文本编辑器根据某些规则以不同的方式“渲染”文本。
How do I customize, extend the text editor, or color tag parts of my code?
I would like Visual Studio to color code parts of my code. Can I use
#region
and give it a color?Is there any way to make the background between two parentheses have a different color? (I want each code "block" to have its own color.)
I've looked here for some insight, but they all are implemented based "on what you select". All I want is to have the text editor "render" the text in a different way based on some rules.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我还没有看到这样的功能,但是 ReSharper 中有一些与您正在寻找的功能非常接近的功能。称为“突出显示匹配分隔符”的设置。使用中看起来像这样:
我想告诉你这一点是因为
1) 您可能对重新磨刀感兴趣
2)resharper 能够突出显示,因此也许有人可以制作一个插件或其他东西来添加此类功能。也许是你? :)
I haven't seen such feature, but there is something quite close to what you are looking for in ReSharper. A setting called "Highlight matching delimiters". Looks like this in use:
I wanted tell you this because
1) You might be interested in resharper and
2) resharper is able to do the highlighting so maybe someone can make an add-in or something to add this kind of feature. Maybe you? :)
我不知道有什么与您要求的完全一样,但 VS10x 代码映射扩展可能会有所帮助: http://www.axtools.com/products-vs2010-extensions.php
它将为您提供侧面代码的一个很好的概述,并使导航更加容易。
右侧的下载按钮可让您从 msdn.microsoft.com 的 Visual Studio Gallery 下载试用版。我想你也可以直接从VS2010的扩展视图中找到它。
I don't know of anything exactly like what you're asking for, but the VS10x Code Map extention might help: http://www.axtools.com/products-vs2010-extensions.php
It will give you a nice overview of the code on the side, and make navigation somewhat easier.
The download button on the right lets you download a trial version from the Visual Studio Gallery at msdn.microsoft.com. I think you can also find it directly from the extentions view in VS2010.