VSCodium - Python modules have no green syntax
Asked Answered
F

2

4

Recently, I'm trying to move from VSCode to VSCodium, and I found a problem is that the green coloring of modules are not in VSCodium (like the picture below).

screenshot

left: VSCode, has the green syntax / right: VSCodium, doesn't have the green syntax.

I saw some other screenshots on the internet that their VSCode also don't have the green syntax, so I think it's not a VScodium problem but I still can't figure out what makes them different.

Federate answered 12/2, 2023 at 14:56 Comment(4)
seems to be a duplicate of Make python code highlighting for VSCodium equal to VSCode. Sadly, that one has no answers yet. See /help/no-one-answers for what to do now.Irresponsible
What happens if you set "editor.semanticHighlighting.enabled": false in your VS Code settings? Does VS Code then appear the same as the VS Codium appearance?Irresponsible
I just added some comments on the other question with some more detailsBoyles
This is related to the python language server and vscode semantic highlighting. You only get green syntax if you also enable semantic highlighting and make sure the python language server is pylance. "editor.semanticHighlighting.enabled": true, "python.languageServer": "Pylance",Extortion
E
0

This is provided by Pylance.

You can add the following codes to your settings.json:

"python.languageServer": "Pylance",
Eo answered 13/2, 2023 at 6:43 Comment(0)
E
0

This is related to two settings:

The green syntax will only be displayed when you need to set to the following at the same time.

"editor.semanticHighlighting.enabled": true,    
"python.languageServer": "Pylance",

That is, semantic highlighting is enabled, and the python language server is pylance.

The python language server setting defaults to "Default": Automatically select a language server: Pylance if installed and available, otherwise fallback to Jedi. So it is possible to get green syntax without modifying this setting, if pylance is available on your machine.

The default value of the "editor.semanticHighlighting.enabled" setting is "configuredByTheme": Semantic highlighting is configured by the current color theme's semanticHighlighting setting., so whether to display green syntax may also be related to the theme you use.

Via @wjandrea's comment below on another question:

I think this is related to the language server. If you still have Code installed, you could check by switching python.languageServer from Pylance to Jedi. Pylance is not supported in unofficial builds.

If pyance is not available in VSCodium then green syntax is not available on it.

A similar effect may be achieved by referring to custom color themes.

Extortion answered 13/2, 2023 at 7:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.