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).
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.
2
Answers
This is provided by Pylance.
You can add the following codes to your
settings.json
:This is related to two settings:
Python Language Server settings
Editor semantic highlighting
The green syntax will only be displayed when you need to set to the following at the same time.
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’ssemanticHighlighting
setting., so whether to display green syntax may also be related to the theme you use.Via @wjandrea’s comment below on another question:
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.