VB.NET 中代码注释和 XML 注释的不同颜色
我注意到,在 C# 中,通过更改“工具”>“XML 注释”和“代码注释”中的设置,可以具有不同的颜色。选项>环境>字体和颜色>显示项目: - 注释:控制代码注释 - XML 注释:控制 XML 注释
这在 C# 中运行良好
///<summary>This XML comment is green</summary>
//This code comment is red
,但在 VB.NET 中不行
'''<summary>This XML comment appears red too even though it's configured as green</summary>
'This code comment is red
有没有办法解决这个问题?
I've noticed that in C# XML comments and code comments can have different colors by changing the settings in Tools > Options > Environment > Fonts and Colors > Display Items:
- Comment: controls code comments
- XML comment: controls XML comments
This works well in C#
///<summary>This XML comment is green</summary>
//This code comment is red
But not in VB.NET
'''<summary>This XML comment appears red too even though it's configured as green</summary>
'This code comment is red
Is there a way to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
VB 和 C# 的着色设置因每种语言而异。
以下是两者之间对应设置的部分列表:
The coloring settings for VB and C# are different for each language.
Here's a partial list of the corresponding settings between the two:
我不知道您使用哪个 IDE 进行开发。对于 Visual Studio 2010,单击“工具”>“工具”>“工具”。选项>环境>字体和颜色。在显示设置下拉列表中,选择文本编辑器。
在显示项目中:选择注释。这将改变代码中注释的颜色。
接下来在“显示项目”中:选择“VB XML 注释”。这将更改所使用的 XML 注释的颜色。可能有 2 个项目同名;我不得不改变第二个。
I don't know which IDE you're using to develop in. For Visual Studio 2010, Click on Tools > Options > Environment > Fonts and Colors. In the Show settings for drop down list, select Text Editor.
In Display Items: select Comment. This will change the color of the comments within code.
Next in Display Items: select VB XML Comment. This will change the color of the XML comments which are used. There may be 2 items with the same name; I had to change the second one.