Syntax highlighting in VS.net 2015

Started by
8 comments, last by DividedByZero 7 years ago

Hi guys,

Does anyone know how (or if it is possible) to turn off syntax highlighting on a particular file? In my case a single 'header' file.

Thanks in advance :)

Advertisement
Perhaps change the file extension to .txt or something? I'm guessing you'll still be able to #include it.

Yeah, that works, but you lose the syntax coloring then. Was hoping to keep the syntax colored but the underlining on errors removed.

What about custom colors?

Save your old fonts and colors as a set, make a new set of fonts and colors where all the items are the color you are looking for, then save that as your uncolored set.

Since the file doesn't change extension it won't happen automatically, but you would get your custom color plain color set.

Yeah, that works, but you lose the syntax coloring then. Was hoping to keep the syntax colored but the underlining on errors removed.


Now I'm confused. Are the errors impossible to fix?

Yeah, that works, but you lose the syntax coloring then. Was hoping to keep the syntax colored but the underlining on errors removed.

Now I'm confused. Are the errors impossible to fix?

No errors, as such.

The include file is written in a language that VS doesn't recognise by default. Hence, all of the distracting red and green squiggles for the syntax it doesn't recognise.

Compiles file though. Just annoyingly distracting.

turn off syntax highlighting on a particular file? In my case a single 'header' file.

Was hoping to keep the syntax colored but the underlining on errors removed.

The include file is written in a language that VS doesn't recognise by default. Hence, all of the distracting red and green squiggles for the syntax it doesn't recognise.

So you want to turn off syntax highlighting for a file, but also leave it on. You want to have a file with a name extension that visual studio recognizes (sounds like .h) but not have it attempt to show compiler errors or syntax issues.

For the latest change of requirements...

In the file's properties (accessed from the project view) I think modifying the build action to "None" or "Additional Files" or similar will make the underlining go away.

As for the syntax highlighting, you write once that you want it disabled and again that you want it enabled, so I'm not sure what you're doing there. There are a few ways to change syntax highlighting keywords, to define new language keyword sets, and even to add entirely new language support to the IDE, as long as it fits the basic parsing rules. Since the quoted statements are directly contradictory (want to turn it off entirely, also hoping to keep) I hope the documentation link is enough to figure out whatever it is you're trying to do.

Are you referring to Intellisense's attempt of pointing out errors/suggestion by syntax highlighting? Because as pointed out, syntax highlighting and coloring are the same thing.

If that's all you want, try as above, alhough I suggest you use a different editor (e.g notepad++) all together in that case

Found an option in the text editor. Funnily enough it is called 'enable squiggles'. Turning this off has done the job. I keep the nicely coloured text, but lose the distracting 'squiggles'.

This topic is closed to new replies.

Advertisement