microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.92k stars 28.46k forks source link

VSCode syntax highlighting is gone! #165225

Closed AnmSaiful closed 3 months ago

AnmSaiful commented 1 year ago

I've been facing this for the last couple of months in Windows and macOS.

I'm not sure exactly when this starts happening, perhaps after a VSCode update or an OS update.

Here's a screenshot for demonstration, which contains a TypeScript code:

image

This also happens with other languages like PHP.

Does this issue occur when all extensions are disabled?: Yes

amal-khailtash commented 1 year ago

So, I finally found my problem. Based on a recommendation, I had added this line to my ~/.bashrc.

ulimit -v $((50*1024*1024))

This limits the Virtual memory usage of any process to a maximum of 50G. I am not sure why VSCode/WebAssembly tries to allocate/reserve that much memory though. After I removed this line and restarted my session, I do not get WebAssembly memory allocation failure and all syntax highlighting works properly now.

So, after all this time, I did not need the debug build!

misirov commented 1 year ago

This will sound crazy, but after two and half months of the report, I've fixed the issue on my end by removing the following line from settings.json.

{
  "workbench.colorTheme": "Visual Studio Dark"
}

Just had the same issue with the latest update. This indeed fixed it on my side

Palmerum commented 1 year ago

@misirov: this solved it for me, too. Actually, I didn't need to delete this line, just change the color theme.

With 1.78 came the new modern black theme as default and VS Code prompted me to try it out. I did but I did not like it and changed it back. And gone was the syntax highlighting. But it only affects the old default "Dark/Light (Visual Studio)" themes. Using another theme solved it for me.

MattTheCuber commented 1 year ago

This will sound crazy, but after two and half months of the report, I've fixed the issue on my end by removing the following line from settings.json.

{
  "workbench.colorTheme": "Visual Studio Dark"
}

This also worked for me. Thanks!

P.S. Set workbench.colorTheme to Default Dark + to keep the same color theme while fixing syntax highlighting.

AlexandrSHad commented 1 year ago

This will sound crazy, but after two and half months of the report, I've fixed the issue on my end by removing the following line from settings.json.

{
  "workbench.colorTheme": "Visual Studio Dark"
}

This also worked for me. Thanks!

P.S. Set workbench.colorTheme to Default Dark + to keep the same color theme while fixing syntax highlighting.

Works for me as well. Thanks.

MohammadMoeinFazeli commented 1 year ago

I use latest version VsCode 1.78.2 and Visual Studio Dark them has the same issue so as other suggested I changed it to Dark+ and now the syntax highlighting works correctly Thanks

altruong commented 1 year ago

This will sound crazy, but after two and half months of the report, I've fixed the issue on my end by removing the following line from settings.json.

{
  "workbench.colorTheme": "Visual Studio Dark"
}

This also worked for me. I updated Vscode and it changed my default theme, a bit weird. Had to switch to Defualt Dark + to keep the same theme without the syntax highlighting breaking.

filip-alexandrov commented 1 year ago

This will sound crazy, but after two and half months of the report, I've fixed the issue on my end by removing the following line from settings.json.

{
  "workbench.colorTheme": "Visual Studio Dark"
}

This issue emerged after the new version introduced new default color. Changing it back to the old "workbench.colorTheme": "Default Dark+" in settings.json solves it.

camronkhan commented 1 year ago

Confirming that reverting back to "Default Dark+" from "Visual Studio Dark" fixed the issue for me, too.

ghost commented 1 year ago

OK EVERYONE. i had the same exact issue. Problem was.. I literally had to turn off my dark mode plug in, unsure why but the code in that plug in automatically assumes all the syntax are in one color and due to that, it processes the outcome in all one color.... overlooked bug.. not a big deal.... but i found the solution!

BBirdselllab commented 1 year ago

Syntax highlight problem with Python in VScode 1.80.0 unfortunately still persists even when the theme is set to : "Default Dark+". Tried suggested workarounds such as disabling dark themes, reinstalling juypter extensions, reinstalling python extensions, etc. VSCode can't seem to distinguish between classes, functions, and variables. Couldn't get the editor.action.inspectTMScopes suggested here working to check deeper but that is my next step.

Commenting to follow progress on the bug and note that the problem persists in latest version making working on large projects difficult.

example1 example2

Version: 1.80.0 Commit: 660393deaaa6d1996740ff4880f1bad43768c814 Date: 2023-07-04T13:40:17.963Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin arm64 22.5.0

677230756E64 commented 1 year ago

I have the same issue on Ubuntu in VS Code with Python extension No module comprehension whatsoever in regards to color, no matter the theme

hbertsch commented 1 year ago

Got the same issue for C# with

Version: 1.80.2 (Universal) Commit: 2ccd690cbff1569e4a83d7c43d45101f817401dc Date: 2023-07-27T21:05:41.366Z (18 hrs ago) Electron: 22.3.14 ElectronBuildId: 22695494 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin arm64 22.5.0

and C# extension v2.0.312

Syntax highlighting is very limited and only highlights very basic things like class / using/ public/ private All my custom types / objects are only rendered in white.

FRReinert commented 1 year ago

Make sure to have this configuration set on VS Code: "editor.semanticHighlighting.enabled": true

This is when the setting is enabled: image

This is when the setting is disabled image

hbertsch commented 1 year ago

Nope, unfortunately this is not it. I already checked this setting before but tried switching it off and on. There is no semantic highlighting available even in a new project:

Bildschirmfoto 2023-08-07 um 15 34 52

Even if I add the "editor.semanticHighlighting.enabled": true to the projects local settings.json it does not help. However, if I use the VS Code Insiger build Version: 1.81.0-insider the semantic highlighting is woking (but only if I add it to the projects settings.json). Seems to be a buggy feature imo.

ghost commented 1 year ago

Turn dark mode off on your browser

Sent from my iPhone

On Jul 27, 2023, at 1:15 PM, 677230756E64 @.***> wrote:

 I have the same issue on Linux VS Code with Python extension No module comprehension whatsoever in regards to color, no matter the theme.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

yongqiang-zhao commented 1 year ago

This happens again at August 4th 2023. It seems to be the problem of vscode, since the highlight is back when I delete the content of user settings json file. I am working on Windows 11.

hbertsch commented 1 year ago

This happens again at August 4th 2023. It seems to be the problem of vscode, since the highlight is back when I delete the content of user settings json file. I am working on Windows 11.

I can confirm, that deletion of the file /Users/YOUR_USER_NAME/Library/Application Support/Code/User/settings.json will fix this issue on macOS too. However this does not explain why the semantic highlightingis breaking in the first place and how this can be fixed without loosing all your personal settings.

Edit:

It seems that the issue is actually comming from the color Theme Dark (Visual Studio). Using the Dark Modern Theme (which is the default after the settings have been deleted) brought back the semantic highlighting for me. I even can continue using my old settings.json file :)

Bildschirmfoto 2023-08-10 um 09 37 38
VSCodeTriageBot commented 10 months ago

Hey @deepak1556, this issue might need further attention.

@AnmSaiful, you can help us out by closing this issue if the problem no longer exists, or adding more information.

NoFart996 commented 10 months ago

Hello

I have the same problem: all variables like minutes, seconds, elapsed_time and so on are not highlited on blue coulor. image

Visual studio code in version 1.83.1 Python interpreter 3.11.3

I have tried to reinsstall all extenstions, change theme, adjust settings.json, reinstall whole VSC. Nothing helped

amal-khailtash commented 9 months ago

I completely gave up on this for a while waiting for debug builds or instructions, but in my case it was memory limit: https://github.com/microsoft/vscode/issues/165225#issuecomment-1441278432 and after that, it was fixed. This has been happening for one user or another for different reasons, but behavior seems the same.

geysernrd commented 9 months ago

As of today, I get the same issue, but in F#. None of the above solutions help. Some syntax coloration is right, but way too much white and no error highlighting.

image

Alastair-L commented 7 months ago

It seems that the issue is actually comming from the color Theme Dark (Visual Studio). Using the Dark Modern Theme (which is the default after the settings have been deleted) brought back the semantic highlighting for me. I even can continue using my old settings.json file :)

Seconded 👍

Fazla-GroM commented 6 months ago

Im having similar issue while using dracula theme. Opened an issue on their repo also https://github.com/dracula/visual-studio-code/issues/245

VSCodeTriageBot commented 3 months ago

Hey @deepak1556, this issue might need further attention.

@AnmSaiful, you can help us out by closing this issue if the problem no longer exists, or adding more information.

VSCodeTriageBot commented 3 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!