Reputation: 502
I've been using monodevelop for a while and was using the 'Monokai' theme. Its coloring was very detailed. As you can see in the screenshot the local and global variables have different colors.
Recently I've started using Visual Studio 2017 and can't seem to find a theme that uses different colors for local and global vars.
I've tried going to Tools->Options->Environment->Fonts and colors
and couldn't find any setting to individually adjust the text colors of locals and globals.
Even though I name these differently, the coloring makes debugging and code reading a bit more easier.
Does anyone know a way to give unique colors to local and global variables?
Upvotes: 4
Views: 5991
Reputation: 60556
This is the default behavior now. VS 2019 and 2022 now color global and local vars/parameters differently by default.
Customized under Tools > Options > Environment > Fonts and Colors
.
For C# these are the items starting with User Members -
.
Upvotes: 4
Reputation: 793
I do not believe there is a way to do this within Visual Studio. There may be a 3rd party add-on/extension that may do this.
UPDATE:
Visual Studio 2019, via a software update, recently changed the granularity in which variables can be color 'coded'. Please see Alex's response below for the now correct answer.
Upvotes: 2
Reputation: 502
Okay, I installed an extension called SemanticColorizer and that did the trick. Still, if anyone has any other solutions, please post it here.
Upvotes: 3