Search code examples
c#visual-studio-2010colorsresharperresharper-8.2

Constructor color in Resharper?


Is it possible in Resharper (8.2) to add custom colors for constructors ?

Currently I don't see any entry

Question

Is there any config file / other way which I can add colors to constructors ?


Solution

  • No, constructors don't have their own custom colour. Instead, if you enable "Color identifiers" in the ReSharper -> Options -> Code Inspections -> Settings page, then constructors are identified as a class identifiers, using the "ReSharper Class Identifier" colour in Visual Studio's options.

    The logic for using "class identifier" here makes more sense when you look at a call to new MyClass(). The MyClass part of that expression is also treated as a class identifier - after all, you're creating a new instance of the MyClass class, and this is also a constructor. So, it makes sense to highlight a constructor declaration and a constructor usage the same, as class identifiers.

    And to answer the other part of the question, there isn't a way to change the colour used by constructors other than changing the class identifier colour.