Migrated from VSCode to VSCodium because "Microsoft bad". Developing python
applications seems to be missing some of the code colors like the modules in turquoise or local variables in light blue in the "Dark +" theme, visible in the comparison below:
Is the right style of code highlighting Microsoft only or am I missing an extension? I tried Manage
>Settings
>tokenColorCustomizations
but the available types like comments
, functions
or keywords
are not python specific, so doing it manually probably won't do the trick.
Edit #1
I seem to have missed the same question which was posted prior to mine. So far I have not been able to make it work within this timespan (summer 2023), but I tried out suggestions and found a few things:
Suggestion #0: Forcing Pylance
Normally, Pylance
is hidden from the VSCodium extensions, but you can still get it via the online VS marketplace as a .vsix
download. Installing it finishes fine, but neither the advanced highlighting nor code completion/suggestions are shown (?). The output of Python Language Server
is reduced to
[info] (Client) You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications [...]
which is neither an error nor a warning, but maybe the confirmation of this post, which basically says that a combination of Pylance
and VSCodium is not possible. Also, adding
"editor.semanticHighlighting.enabled": true,
"python.languageServer": "Pylance"
does not seem to work for me.
Suggestion #1: "Just use pyright"
From the docs:
For most VS Code users, we recommend using the Pylance extension rather than Pyright. Pylance incorporates the Pyright type checker but features additional capabilities such as semantic token highlighting and symbol indexing. You can install the latest-published version of the Pylance VS Code extension directly from VS Code. Simply open the extensions panel and search for “Pylance”.
As if that isn't discouraging enough, installing pyright
anyway fails with this error (Vscodium 1.81.1 for Win x64):
Pyright has detected that the Pylance extension is installed. Pylance includes the functionality of Pyright, and running both of these extensions can lead to problems. Pyright will disable itself. Uninstall or disable Pyright to avoid this message.
Fair enough, as Pylance
is installed and probably still configured in settings.json
. However, adding "python.languageServer": "Pyright"
there shows me a value error Value is not accepted. Valid values: "Default", "Jedi", "Pylance", "None".
. As the docs redirect me to Pylance
, I am not sure what to put in here to select Pyright
. Additionally, this may not even tackle the original problem, as it only employs static typechecking and not semantic highlighting as mentioned in the comments of the related post.
Suggestion #2: "Use Jedi"
Switching to "python.languageServer": "Jedi"
and reloading the window changes nothing about the highlighting, but at least enables reliable auto-completion. Where Jedi
is installed or where it comes from is a mystery to me, so I assume that it is built in. While this is an acceptable solution to having basic highlighting and completion, it also does not tackle the original question.
Suggestion #3: Copy-Paste hackery
This results in all sort of version errors if the default extensions are installed in VSCode and then manually moved to VSCodium. The former installs for 1.82 and the latter for 1.81. Reverting extensions to previous versions leads me back to suggestion #1.
Further works
~~If it can't be achieved, then so be it and I'll use Jedi
. However, I remember having an old laptop with VSCodium which was running Pylance
fine, so it's either me messing up or it was a compatibility change over time. I will investigate this soon and add updates here.~~
Edit #2
Recent developments regarding this issue suggest that Pylance, as a proprietary product of Microsoft, is being reinforced in fending off "non-official" usage such as installing it with VSCodium. Relevant links:
- Semantic highlighting for Python: Pylance issue 2023
- Solution to Pylance not working with VSCodium #1641
- Solution to Pylance not working with VSCodium #1640
This is very much in the power of Microsoft. It's their language server and nothing will change that. I have been using jedi
for half a year now, it sadly is not as powerful as Pylance. However, I found a solution.
This solution is so benign and unexplainable to me, that I do not necessarily recommend depending on it, because it might just break like all the other solutions listed in the provided links. Somewhere in one of these discussions somebody posted a link to a specific Pylance version 2023.6.40
download. Installing it manually over the "install from .vsix
option in VSCodium actually works (tested for Windows 10), which very much surprised me at this point.
All in all this seems like another instance of the Freeware vs. FLOSS dilemma, whereby a free product creates issues with the FLOSS community on an ethical basis because it is very purposefully free but not FLOSS. And since "free but not FLOSS" does not actually exist, you pay in telemetry data, which is exactly what drives people to FLOSS options in the first place.
python.languageServer
from Pylance to Jedi. Pylance is not supported in unofficial builds. – Injury"editor.semanticHighlighting.enabled": false
in your VS Code settings? Does VS Code then appear the same as the VS Codium appearance? – Holohedralos
is an imported name, but on Codium, Jedi doesn't seem to provide any of that, so you're stuck with basic TextMate-powered highlighting. That is, unless you want to do the hack to allow Pylance. – Injury