VS Code 1.86 Less syntax highlighting not correct

77 views Asked by At

Syntax highlighting in VS Code (v1.86.1) for Less files is incorrect for certain properties and values. Here are some of the properties there are issues with, though most properties/values are correctly highlighted. Highlighting seems to be correct with these same properties in SASS and CSS.

incorrect syntax highlighting

I have tried deleting everything in my settings.json related to Less, I tried installing the extension Prettier and set it to be the default formatter for all files, and I have restarted the application after changing settings, after disabling various extensions, etc; but nothing seems to change the highlighting.

1

There are 1 answers

1
starball On

I highly suspect this being due to the Less grammar update that happened in the VS Code update that just happened (1.86). See the release notes:

The previous Less grammar has been archived and VS Code now uses the grammar from Better-Less for Less syntax highlighting.

The relevant VS Code issue ticket tracking this is Consider adopting a new Less grammar #171239

If you find a bug, you should first check if an issue ticket has been raised in the better-less repo's issue tracker, and if not, raise one there. You could also instead/additionally raise the issue ticket in VS Code's issue tracker, but you may as well just report upstream.