0

My apologies if this has already been asked and answered but I have searched for an answer and cannot find what I am looking for despite always feeling like I am close yto the solution.

I am using Visual Studio 2022 and I am working with a CMake project (though I do not believe this is relevant). I have Environment->General->Color Theme = Dark. I did not set any custom color schemes. I even went so far as to set everything, that I could find, back to defaults.

The issue I am experiencing is when I am declaring a variable, i.e. uint8_t myVar. While I am typing "myVar" Visual Studio highlights the text, which then makes it unreadable myVar unreadable in dark them

Once I finish it with a semi-colon the highlighting goes away and I can read it. Until I want to modify the text. I'm aware I can do a refactor but I shouldn't have to do that to be able to read text I want to modify.

If I perform the same action in Theme = Light I get enter image description here

Clearly visible and highlighted.

How do I adjust the highlighting to be a better color or just disable it altogether?

I have searched through Options->Environment->Fonts and Colors until I ran out of ideas on more than one occasion.

My current workaround is to comment the line so that I can modify the text without it highlighting. However, I feel as though I shouldn't have to do this.

I have also noticed that it only happens with the variable declarations. The highlighting does not appear when I modify the variable name inside of a function that I am using it in.

It also does not matter whether the variable is a public global, local variable in a function, or a static variable in or outside a function. They all exhibit the issue for declared variables.

2
  • I apologize I dont know/remember the setting but you should be able to go into VS settings and change the color for this (or stop it from appearing at all). I did it in SSMS and was able to change the underline to the same color as the background (because I just didnt want to see it anymore for cases like this). Commented Jan 28 at 20:05
  • I suffer from this same issue. I have spent more time than any reasonable person should spend digging through the endless number of settings under Options. I have not found the secrete sauce to get rid of this ignoring issue. @TheodoreR were you ever able to find a solution? Commented Sep 12 at 18:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.