0

Is there a way to color template parameters differently from normal classes in VS 2017? They both seem to fall under the C++ User Types category.

Coloration example

In this example, I would like to have different colors for NormalClass and TemplateParameter

Irhala
  • 135
  • 12

1 Answers1

0

I couldn't find something like this in default configuration. However, there is some extensions around. I found JRKeywords to be able to give custom colour for types that end with 'T'. You can use that, and name your template parameters accordingly. And if that's not to your liking you can make your own extension.

As alternative solution, you can just name your template parameters with 'T' as prefix, like TSocket or something. This would give you easy way to distinguish between ordinary type and templated one even without custom highlighting, and I think that this is enough.

Shorrer
  • 104
  • 2
  • 3
  • Thanks for your answer! Unfortunately, I'd like to make it work without naming conventions to avoid trouble with group projects and code that doesn't follow them. Making an extension looks interesting but I'm not sure how long it would take for such a "small thing". – Irhala Aug 10 '18 at 18:03