Visual Studio 格式设置 - 更改方法颜色

发布于 2024-08-31 20:45:24 字数 154 浏览 3 评论 0原文

方法的默认外观(例如“.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

围归者 2024-09-07 20:45:24

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

巴黎夜雨 2024-09-07 20:45:24

您可以使用扩展来完成此操作: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.

離人涙 2024-09-07 20:45:24

要更改方法调用的颜色,请转到

工具>选项>环境>字体和颜色>用户成员-方法>项目前景颜色>选择所需的颜色。

这也适用于 Visual Studio 2019。

To change the color of the Method Calls go to

Tools > Options > Environment > Fonts and Colors > User Members - Methods > Item foreground Color > Select desired color.

This will also work in Visual Studio 2019.

不可一世的女人 2024-09-07 20:45:24

对于 Visual Studio 2010

工具 >选项

环境>字体和颜色

更改“用户类型”

For Visual Studio 2010

Tools > Options

Environment > Fonts and Colors

Change "User Types"

娇女薄笑 2024-09-07 20:45:24

转到 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.

初心 2024-09-07 20:45:24

就我自己而言,我基于异步 Roslyn API语法突出显示 用户标记,为 Visual Studio 编写了一个简单、轻量级的“编辑器分类器扩展” C#Visual Basic 代码。

它具有以下语法突出显示

  • 事件
  • 字段
  • 字段(常量)
  • 字段(枚举内部)"
  • "局部变量"
  • "方法"
  • "方法(扩展)"
  • "方法 ( Static)"
  • "命名空间"
  • "参数"
  • "属性"

将来,可能会出现在“语法”中突出显示”用于其他内容。

您可以通过以下链接从 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:

  • "Events"
  • "Fields"
  • "Fields (Constant)"
  • "Fields (Inside Enums)"
  • "Local Variables"
  • "Methods"
  • "Methods (Extension)"
  • "Methods (Static)"
  • "Namespaces"
  • "Parameters"
  • "Properties"

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.

伤感在游骋 2024-09-07 20:45:24

内置语法荧光笔使用词法分析。词法分析器可以对标识符、注释、文字、数字、关键字进行分类。您可以在“工具”>“工具”中找到的部件选项>环境>字体和颜色对话框。

识别标识符是方法、属性、字段需要解析。通常,只有当您拥有格式良好的程序时,解析才能正常工作,而在您键入代码时很少有这样的程序。因此并没有受到微软的青睐。您可以在 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.

随波逐流 2024-09-07 20:45:24

感谢“@Ian”所说的用户类型。对我来说“用户成员 - 方法”有效。

  1. 工具
  2. 选项
  3. 环境
  4. 字体和颜色
  5. 显示项目中的
  6. :“用户成员 - 方法”更改项目前景

Thanks to "@Ian" said User Types. For me "User Members - Methods" worked.

  1. Tools
  2. Options
  3. Enviromment
  4. Fonts and Colors
  5. In Display items: "User Members - Methods"
  6. Change Item foreground
一笔一画续写前缘 2024-09-07 20:45:24

语义着色器对我不起作用(VS 2019 预览版)。

增强语法突出显示正是我所需要的。

Semantic Colorizer didn't work for me (VS 2019 Preview).

Enhanced Syntax Highlighting did exactly what I needed.

稀香 2024-09-07 20:45:24

工具>>选项>环境>字体和颜色有一个广泛的列表,您可以更改字体、字体大小、颜色、样式等。

此外,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.

鱼忆七猫命九 2024-09-07 20:45:24

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文