2

When editing JavaScript files in Visual Studio Code on my Mac I'm only seeing very basic syntax highlighting. The same also applies for TypeScript files.

I'm certain there used to be more syntax highlighting when editing JavaScript and TypeScript files.

I already tried to disable all extensions but it didn't help.

Visual Studio Code version: 1.25.1

How can I re-enable proper syntax highlighting in Visual Studio Code?

Svein Fidjestøl
  • 3,106
  • 2
  • 24
  • 40

3 Answers3

2

Please try to switch color theme back and forth (Ctrl/CMD+Shift+P and type theme and then select random one. Repet procedure to revert to one you choose).

For me it solves issues with syntax highlighting in version 1.38.1

Tomas
  • 3,269
  • 3
  • 29
  • 48
  • This was the fix for me when they recently changed the default theme, and I wanted the previous theme. Appears they broke some of the highlighting in that theme. – Reisclef May 30 '23 at 16:09
1

Uninstall Visual Studio Code using the description here: How to completely uninstall vscode on mac

After a reinstall of Visual Studio Code syntax highlighting works fine again.

Svein Fidjestøl
  • 3,106
  • 2
  • 24
  • 40
-1

I had some problems with my js/ts codes syntax highlighting.

(In the basic theme, 'functions' don't turn yellow, 'booleans' don't turn dark blue, 'types' don't turn green. However, when I hovered them, they showed the right colors)

I looked for the answer everywhere but not solved. Today I accidentally uninstalled the extension "Syntax Highlighter", and it just solved.

enter image description here

I believe this is not the problem of the extension, but it may somehow cover the config of original js/ts.

Hope this can help someone who has the same problem.

JXIU
  • 11
  • 1