user14131782
user14131782

Reputation: 1068

VSCode JavaScript syntax highlighting

I've recently returned to using VSCode after a long break. It seems that after updating, the syntax highlighting colours have changed to this:

after

From this:

before

Does anybody know how to achieve the look in the second image? I really can't stand the inconsistent brace colouring. If this isn't a change made in updates and I'm doing something wrong, please let me know

Upvotes: 1

Views: 3939

Answers (2)

Adrian Drummond
Adrian Drummond

Reputation: 9

I ran into this issue recently and I think the problem is caused by the Language Mode that VS Code used based on the language it detects.

I was using Auto Detect and I realized I should have been explicitly setting the language to Javascript using the button in the bottom right corner of the editor.

Bracket pair colorization will be preserved, but the syntax highlighting will change to what you expect.

Finally, Javascript seams to be the best, but Auto Detect may select Typescript or JSX where the Language mode is different.

Note: I think primitives, objects, and reserved words are hightlighted uniquely. It's helpful once you realize it.

I hope this helps someone else.

Helpful Images:

Javascript

Auto Detect

Upvotes: 0

Delapouite
Delapouite

Reputation: 10157

It appears you want to disable the bracket pairs colorization.

Here's a blog post from the VSCode team, talking about this new highlighting feature introduced recently : https://code.visualstudio.com/blogs/2021/09/29/bracket-pair-colorization

To do so, set the following settings to false :

"editor.bracketPairColorization.enabled": false,
"editor.guides.bracketPairs": false,

Upvotes: 2

Related Questions