In my case, it was just the theme issue. After the latest update, VSCode changed the theme to Dark Modern which is fine, but I wanted to use my existing one so I selected the Dark Theme (but my previous one was actually Dark+).
The difference between the two is the syntax highlighting feature so switching to the Dark+ Theme fixed the syntax highlighting not being enabled.
Answer from Irfan wani on Stack OverflowIn my case, it was just the theme issue. After the latest update, VSCode changed the theme to Dark Modern which is fine, but I wanted to use my existing one so I selected the Dark Theme (but my previous one was actually Dark+).
The difference between the two is the syntax highlighting feature so switching to the Dark+ Theme fixed the syntax highlighting not being enabled.
I also had the same problem for TypeScript React (.tsx) files though in my case it was due to the JavaScript & TypeScript Nightly extension so disabling it fixed my syntax highlighting.
Hi all.
I'm a complete newb on VS Code.
Below is my hello.c program -- as you can see there is no syntax highlighting.
I have only one extension enabled: Microsoft's C/C++ IntelliSense, debugging, and code browsing. v1.14.4
What am I doing wrong?
(Also, F5 does not actually run anything, but I'd like to solve the syntax highlighting first.)
Thanks in advance!
-C
No syntax highlighting Microsoft's C/C++ IntelliSense, debugging, and code browsing. v1.14.4Videos
Across all themes, my syntax highlighting is not working correctly. Although it works for certain things (ie. import turns purple and strings turn orange for dark+ theme), other fields are simply white. For the dark+ theme, variables should be blue in color, the declaration (field) string should be green, and cout/cin should be blue, but all of these appear white. I've tried to reinstall vscode, completely whipping existing settings, but nothing works. Any help would be appreciated! I'm quite new to vscode so this could be a very simple fix, but nothing I've tried has been successful.
Photo for reference:
I just downloaded VS code so im new, but the syntax highlighter doesnt seem to be working at least for c. for instance if i try to use a varible that i forgot to declare, i don't get any errors or indicator until i've saved and complied the file. Sorry for the noob question. Is there anyway to fix this.
I think you mean something other than syntax highlighting, syntax highlighting is simply the colourful text.
If you mean notifications for undefined variables and the like, that's generally called "intellisense".
https://i.imgur.com/CLmFvQg.png
For C/C++ you're looking for the aptly named extension "C/C++" here
Syntax Highlighting in VS Code is not context aware. It uses a system called tmLanguage Grammars to define syntax which themes then use to apply colour. The tmLanguage format uses RegEx so it matches what it knows to be the correct format for say a variable but it has no way of knowing if it has been declared or is being used correctly.
Using a function invocation as an example myFunction(); the RegEx would be something like \w\p{L}+\(.*?\)\; (obviously over simplified for this example.) Since that RegEx will match whether you declared the function previously or not (this is why it's called "context unaware") the highlighting is not a good indicator or syntax validity.
VS Code includes tmLanguage files to provide highlighting for a huge number of languages out of the box because they're light weight. If you need linting (which will put a red squiggly line under bad syntax) you need to install the relevant extension for the language you're working in.
I think this was caused by the extension called JavaScript and TypeScript Nightly. This was causing the syntax highlighting for .js and .ts files (.jsx and .tsx too). This was more of a bug with the latest version (currently 1.73.1).
You can disable the extension to enable the syntax highlighting.

This extension has now been updated and this issue is fixed.
What user Haneen said was correct, but instead of disabling it, you can install an old version that works just fine.
Click the cog on the bottom right → 'Install Another Version' → select an older version.
Cog at bottom right
I'm a game developer that works with Unity. For some reason, after about a month ago, my syntax highlighting for types stopped working. They're usually highlighted in green. Here's my code:
Bugged Syntax HighlightingThe Assembly references, Text, GameObject, & ToggleController names are all supposed to be green. The syntax highlighting works when I first open a file, but after I open a second file, the syntax highlighting disappears. I tried downgrading from 1.9.2 to 1.9.1 to solve the problem, and also reenabled the Unity extension. I've put Unity in Debug Mode. However, I'm still getting the same error in the console (here):
Error LogHere are my auto update settings:
Update SettingsPlease help me figure out what's conflicting so I can enjoy VS Code with syntax highlighting again.