Visual Studio formatting - changing the color of a method

By default, the appearance of a method, for example, .ToString () "is black by default. I want to make it a different color to stand out, but I do not see any options that refer to this option.

I remember one of my former colleagues showing me his VS IDE a few years ago, and he set it up like that, but I can't remember what he did.

Does anyone have any ideas on how to do this?

+10
source share
8 answers

Built-in syntactic markers use lexical analysis. The lexer can classify identifiers, comments, literals, numbers, keywords. The parts that you find in the Tools> Options> Environment> Fonts and Colors dialog box.

Recognizing that an identifier is a method, a property, a field requires parsing. Analysis, as a rule, works well only when you have a well-formed program, you rarely have one when you enter the code. Microsoft did not support Microsoft. You can find alternatives in the Visual Studio gallery .

+1
source

You can do this with the extension: I am using SemanticColorizer .

Tools → Extensions and Updates → Online → Search SemanticColorizer

It allows you to change the colors of methods, static functions, constants, member variables, and anything else you can think of.

+19
source

Go to Visual Studio "Tools"> "Options"> "Environment"> "Fonts and colors", the menu displays a list of "Displayed items", select "Identifiers" (of which "methods" are members). Use format controls to personalize the display of the item you select. Unfortunately, variables, instances, and namespaces are members of Identifiers, so they will also be affected.

If you use Resharper, a more specific list of items will be displayed.

+8
source

For Visual Studio 2010

Tools> Options

Environment> Fonts and Colors

Change "User Types"

+5
source

For myself, I wrote a simple, easy “editor classifier extension” for Visual Studio based on Roslyn's asynchronous APIs before syntax highlighting user tags in C # and Visual Basic .

It has syntax highlighting for:

  • " Events "
  • " Fields "
  • " Fields (constant) "
  • " Fields (Inside Enums) "
  • " Local variables "
  • " Methods "
  • " Methods (Extension) "
  • " Methods (static) "
  • " Namespaces "
  • " Options "
  • " Properties "

Syntax may appear in the future for something else.

You can install this extension from the Visual Studio Marketplace by following the link below:

Download: " Improved syntax highlighting ."

You can change the syntax highlighting settings by choosing Tools > Options > Environment > Fonts & Colors > Text Editor and scrolling to properties starting with the prefix " User Labels -... ".

syntax highlighting for Classes , Delegates , Enumerations , <Strong> Interfaces, Modules , Structures , and Type Parameters are below, they have the prefix " User Types -... " and are built-in default.

Good luck.

+3
source

To change the color of method calls go to

Tools> Options> Environment> Fonts and Colors> User Elements - Methods> Element Foreground Color> Select the desired color.

This will also work in Visual Studio 2019.

0
source

Tools> Options> Environment> Fonts and colors contains an extensive list of things that you can change like font, font size, color, style, etc.

In addition, Jeff Atwood had an excellent article a few years ago about an IDE font and color schemes that you might find interesting.

-1
source

A previous version of visual studio (I think 2010) introduced a plugin that allowed you to code color methods. I do not remember the name of it now, as we continued to move forward in the versions. The author did not keep up with the updates of the VS version.

Update: VS10x allows color coding methods in Visual Studio completely through VS2015. A link to the authors page of the Visual Studio gallery can be found here: https://visualstudiogallery.msdn.microsoft.com/1c54d1bd-d898-4705-903f-fa4a319b50f2?SRC=VSIDE

I am currently using this successfully in VS2013.

-1
source

Source: https://habr.com/ru/post/1309360/


All Articles