Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code syntax highlighting not working

I am using Visual Studio Code (VSC) as my IDE. My computer just updated to Catalina 10.15.2 (19C57) and since the update, now VSC is not highlighting syntax errors. The extensions I have seem to be working and it recognizes my miniconda python environment.

Is there a solution for this yet? I was avoiding Catalina as I know it has caused lots of errors, but now that I was forced to install it I need a solution as I love VSC.

code with errors

enter image description here

like image 425
Diego Serrano Avatar asked Jan 16 '20 17:01

Diego Serrano


People also ask

How do I enable syntax highlighting in Visual Studio?

press CTRL + K then press M.

How do I change syntax highlighting in VS Code?

To change the text and syntax colors in visual studio code follow the steps given below: Open VS Code editor to change the syntax colors. Go to Settings, which is on the bottom left corner of the VS Code window. In the search field type JSON, and click on the 'Edit in settings.

Why is my IntelliSense not working?

If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.


2 Answers

It's very specific but for me it was a missing semicolon in my css (styled-component). I use styled-components in react and it didn't throw an error for missing semicolon but highlighting was suddenly gone. I had given up and left it that way until I came up with the solution quite by accident.

like image 171
M_droid Avatar answered Oct 16 '22 11:10

M_droid


In my case, the Catalina installation didn't remove my Python installation.

After checking as suggested by @Brett Cannon in his comment, the update to Catalina uninstalled some extensions from VS Code. These are not available in the VS Code extension Marketplace anymore, so there must be an issue regarding compatibility. I fixed it after I opened my command palette (Command + Shift + p) and typed python: select linter. Then selected pylint, selected the install with conda option, Close/Open VS Code and now it's working(though it's still not shown in my extensions section in VS Code). It's necessary to point out that you will have to install pylint in every Python environment you are using. In my case I have multiple Conda environments.

like image 26
Diego Serrano Avatar answered Oct 16 '22 11:10

Diego Serrano