Visual Studio 格式设置 - 更改方法颜色
方法的默认外观(例如“.ToString()”)默认为黑色。我想将其设置为不同的颜色以脱颖而出,但我没有看到任何专门引用此选项的选项。
我记得一位前同事几年前向我展示了他的 VS IDE,他是这样设置的,但我不记得他做了什么。
有人对如何做到这一点有任何想法吗?
The default appearance of a method for example, ".ToString()" is by default the color black. I want to make it a different color to stand out but I do not see any options that reference this option specifically.
I remember one of former collegues showing me his VS IDE years ago and he had it setup this way but I cannot recall what he did.
Does anyone have any ideas on how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
在 VS 2019 中,转到“工具”-“选项”-“文本编辑器”-“C#”-“高级”-“编辑器配色方案”,并将其更改为 Visual Studio 2019。方法名称现在已着色,并且所有内容都有更好的颜色。
In VS 2019 go to Tools - Options - Text Editor - C# - Advanced - Editor Color Scheme and change it to Visual Studio 2019. Method names are now colored and everything has little bit better colors.
您可以使用扩展来完成此操作:SemanticColorizer< /strong> 是我使用的。
工具 -> 扩展和更新 -> 在线 ->搜索SemanticColorizer
它允许您修改方法、静态函数、常量、成员变量以及您能想到的任何其他内容的颜色。
You can do this with an extension: SemanticColorizer is what I use.
Tools -> Extensions and Updates -> Online -> Search for SemanticColorizer
It allows you to modify the colors of methods, static functions, constants, member variables, and just about anything else you can think of.
要更改方法调用的颜色,请转到
这也适用于 Visual Studio 2019。
To change the color of the Method Calls go to
This will also work in Visual Studio 2019.
对于 Visual Studio 2010
工具 >选项
环境>字体和颜色
更改“用户类型”
For Visual Studio 2010
Tools > Options
Environment > Fonts and Colors
Change "User Types"
转到 Visual Studio“工具>选项>环境>字体和颜色”菜单显示“显示项目”列表,选择“标识符”(其中“方法”是其中的成员)。使用格式控件来个性化您所选项目的显示。不幸的是,变量、实例和命名空间都是“标识符”的成员,因此它们也会受到影响。
如果您使用 Resharper,则会显示更具体的项目列表。
Go to Visual Studio "Tools>Options>Environment>Fonts and Colors" the menu shows a "Display Items" list, select "Identifiers"(out of which 'methods' is a member). Use the format controls to personalize the displaying of your chosen item. Unfortunately, variables, instances and namespaces are members of "Identifiers" so they will affected too.
If you are using Resharper then a more specific list of items is displayed.
就我自己而言,我基于异步 Roslyn API 到 语法突出显示 用户标记,为 Visual Studio 编写了一个简单、轻量级的“编辑器分类器扩展” C# 和 Visual Basic 代码。
它具有以下语法突出显示:
将来,可能会出现在“语法”中突出显示”用于其他内容。
您可以通过以下链接从 Visual Studio Marketplace 安装此扩展:
下载:“增强语法突出显示"。
您可以通过转到“工具”>“更改语法突出显示设置” “选项”> “环境”> “字体和颜色”> “文本编辑器”并滚动到以前缀“用户标签 - ...”开头的属性。
“类”、“委托”、“枚举”、“接口”的语法突出显示选项”、“模块”、“结构”和“类型参数”就在下面,它们的前缀为“ >用户类型 - ...”并且是内置默认值。
祝你好运。
For myself, I wrote a simple, lightweight "editor classifier extension" for Visual Studio based on the async Roslyn APIs to Syntax Highlighting user tags in C# and Visual Basic code.
It has syntax highlighting for:
In the future, perhaps coming on the "syntax highlighting" for something else.
You can install this extension from the Visual Studio Marketplace by following the link below:
Download: "Enhanced Syntax Highlighting".
You can change the syntax highlighting settings by going to "Tools" > "Options" > "Environment" > "Fonts and Colors" > "Text Editor" and scrolling to properties starting with the prefix "User Tags - ...".
The syntax highlighting options for "Classes", "Delegates", "Enums", "Interfaces", "Modules", "Structures" and "Type Parameters" are just below, they have the prefix "User Types - ..." and are built-in default.
Good luck.
内置语法荧光笔使用词法分析。词法分析器可以对标识符、注释、文字、数字、关键字进行分类。您可以在“工具”>“工具”中找到的部件选项>环境>字体和颜色对话框。
识别标识符是方法、属性、字段需要解析。通常,只有当您拥有格式良好的程序时,解析才能正常工作,而在您键入代码时很少有这样的程序。因此并没有受到微软的青睐。您可以在 Visual Studio 库中找到替代方案。
The built-in syntax highlighters use lexical analysis. A lexer can classify identifiers, comments, literals, numbers, keywords. The parts you find back in the Tools > Options > Environment > Fonts and Colors dialog.
Recognizing that an identifier is a method, property, field requires parsing. Parsing generally only works well when you've got a well-formed program, you rarely have one while you are typing code. So wasn't favored by Microsoft. You can find alternatives in the Visual Studio gallery.
感谢“@Ian”所说的用户类型。对我来说“用户成员 - 方法”有效。
Thanks to "@Ian" said User Types. For me "User Members - Methods" worked.
语义着色器对我不起作用(VS 2019 预览版)。
增强语法突出显示正是我所需要的。
Semantic Colorizer didn't work for me (VS 2019 Preview).
Enhanced Syntax Highlighting did exactly what I needed.
工具>>选项>环境>字体和颜色有一个广泛的列表,您可以更改字体、字体大小、颜色、样式等。
此外,Jeff Atwood 几年前发表了一篇关于 IDE 字体和配色方案,您可能会感兴趣。
Tools > Options > Environment > Fonts and Colors has an extensive list of things you can change both font face, font size, color, style, etc.
Also, Jeff Atwood had a great post a few years ago about IDE font and colour schemes that you might find interesting.
在 Visual Studio 的早期版本(我认为是 2010 年)中,有一个插件可以让您对方法进行颜色编码。我现在不记得它的名字了,因为我们在版本中不断前进。作者没有跟上VS的版本更新。
更新:VS10x 允许您在 Visual Studio 中一直到 VS2015 中对方法进行颜色编码。可以在此处找到作者 Visual Studio 画廊页面的链接:https://visualstudiogallery.msdn.microsoft.com/1c54d1bd-d898-4705-903f-fa4a319b50f2?SRC=VSIDE
我目前在VS2013中成功使用它。
In a previous version of visual studio (I think 2010) there was a plugin that allowed you to color code methods. I don't remember the name of it now as we have continued to progress forward in versions. The author did not keep up with the version updates of VS.
Update: VS10x allows you to color code methods in Visual Studio all the way through VS2015. A link to the authors Visual Studio Galleries page can be found here: https://visualstudiogallery.msdn.microsoft.com/1c54d1bd-d898-4705-903f-fa4a319b50f2?SRC=VSIDE
I am currently using this in VS2013 successfully.