Aaroninus
Aaroninus

Reputation: 1112

Visual Studio change C# method parameter colouring

In Visual Studio 2013, is there a way to change the syntax colouring of C# method parameters?

e.g. Can I have AAA and BBB colored, but not someInt, Foo, ToString

private int MyMethod(int AAA, int BBB)
{
    int someInt = new int();
    someInt = AAA + BBB;
    string Foo = AAA.ToString();
}

I tried going to Tools -> Options -> Environment -> Fonts and Colours -> Text Editor and changing Identifier, but this changed the coloring of just about everything (variables, methods, parameters).

Upvotes: 10

Views: 11825

Answers (5)

Usman Farooq
Usman Farooq

Reputation: 1098

Now you can do this in Visual Studio without any extension.

Here is VS 2022

enter image description here

Upvotes: 3

Strider489
Strider489

Reputation: 67

For VS 2017 you can use.

Enhanced Syntax Highlighting by Stanislav Kuzmich

https://marketplace.visualstudio.com/items?itemName=StanislavKuzmichArtStea1th.EnhancedSyntaxHighlighting

Upvotes: 1

Krasen
Krasen

Reputation: 61

I recently found this extention while looking for the same thing for TypeScript, apparently it supports C# and VisualBasic, so it may be helpful for you and anybody else looking:

Visual studio SemanticColorizer

Upvotes: 6

Lucas Trzesniewski
Lucas Trzesniewski

Reputation: 51430

ReSharper can do this.

First, check this in ReSharper options:

ReSharper options

Then choose the color in the VS options:

VS options

End result:

enter image description here

Upvotes: 11

James Jensen
James Jensen

Reputation: 731

Unfortunately, you will not find a way to colorize parameter variables with the C# language. You do have the option, however, of writing an extension to do just that. Or, you could rewrite everything in C++, where you can get your parameters colorized.

Upvotes: -6

Related Questions