Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: IntelliCode won't work on VSCodium #1646

Open
cdhainaut opened this issue Sep 18, 2023 · 17 comments
Open

python: IntelliCode won't work on VSCodium #1646

cdhainaut opened this issue Sep 18, 2023 · 17 comments
Labels
bug Something isn't working

Comments

@cdhainaut
Copy link

Hi,

I am not able to use IntelliCode inside VSCodium. I checked with VSCode and it works perfectly.
I have same release version on VSCodium and VSCode (1.82.2)
The extensions I have are:

  • Pylance v2023.9.10
  • IntelliCode 1.2.30
  • Python v2023.16.0
    On both VSCodium and VSCode

I run a laptop with Linux Mint 21.2 on it

The error I get on VSCodium is:

Language server is set to "Default". Pylance is used as current language server.
Acquiring model
vs-intellicode-python was passed a model: {}.
Acquiring model 'intellisense-members-lstm-pylance' for python
Querying IntelliCode service for available models.
Cached model is up to date.
Activating Python extension
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found
    at w._tryExecuteCommand (vscode-file://vscode-app/usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:1536:16054)
    at w.executeCommand (vscode-file://vscode-app/usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:1536:15936)
Error while activating Python: {}

Thank you

@cdhainaut cdhainaut added the bug Something isn't working label Sep 18, 2023
@GitMensch
Copy link
Collaborator

@cdhainaut
Copy link
Author

Hi,

Thanks for the link. Although I don't quite understand why suddenly it does not work anymore as I did not have any issue in the past year using codium

@daiyam
Copy link
Member

daiyam commented Sep 21, 2023

It depends on the goodwill of those extensions. Sometime times it works, some others it doesn't.

@bebenlebricolo
Copy link

bebenlebricolo commented Oct 7, 2023

+1 here.
Tested altogether with VSCode Insiders as well -> No pb in VScode Insiders, works out of the box.

That's weird, as regular logs in vscodium don't provide much intel (I mean Python Extension logs in the Output window) about anything being wrong !

However, I just found that in the settings > Python > Language Server, if you change that from default (Pylance) to the usual fallback LServer (Jedi), then at least autocompletion seems to start working again.
Might not be as powerful as their new Pylance LS (if Jedi is the fallback, I suppose there are good reasons for this), but at least it gets it functional again...

image

Probably some more troubleshooting is required on the Pylance side (?).

[Edit] : hum sorry, the LSP error was dully noted in the first part of the issue, and I just flew over it without noticing 🥲

@TechPro424
Copy link

Same issue, even Jedi does not give autocomplete in my case

@raycekar
Copy link

raycekar commented Dec 29, 2023

Sadly same here,

Version: 1.85.1 (user setup)
Release: 23348
Commit: 08e6c15293922dd53a864bb041be381322fee401
Date: 2023-12-14T20:44:42.949Z
Electron: 25.9.7
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

Latest python extension installed in vscodium.

Installed vscode with python addon and does in fact work

@TechPro424
Copy link

TechPro424 commented Jan 21, 2024

Bump

I get an error in the VS Intellicode output (in the output tab, selected VS Intellicode from the dropdown)

Language server is set to "Default". Pylance is used as current language server.
Acquiring model
vs-intellicode-python was passed a model: {}.
Acquiring model 'intellisense-members-lstm-pylance' for python
Querying IntelliCode service for available models.
Cached model is up to date.
Activating Python extension
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found
    at I._tryExecuteCommand (vscode-file://vscode-app/c:/Users/TechPro424/scoop/apps/vscodium/1.85.1.23348/resources/app/out/vs/workbench/workbench.desktop.main.js:1544:16102)
    at I.executeCommand (vscode-file://vscode-app/c:/Users/TechPro424/scoop/apps/vscodium/1.85.1.23348/resources/app/out/vs/workbench/workbench.desktop.main.js:1544:15984)
Error while activating Python: {}

@GitMensch
Copy link
Collaborator

GitMensch commented Jan 21, 2024

Language server is set to "Default". Pylance is used as current language server.
...
Activating Python extension
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found

Pylance is proprietary, according to the setting definition it should only be chosen if available, which isn't the case.
Looks like an error in that extension (you may want to file an issue "Default setting for Language Server chooses Pylance while not available" there) - which you may be able to workaround by explicit setting python.languageServer to Jedi.

Did you have a look at https://github.com/VSCodium/vscodium/wiki/Extensions-Compatibility?

It depends on the goodwill of those extensions. Sometime times it works, some others it doesn't.

I'm not sure if there's anything more we can do, so consider to close this issue.
As all things mentioned here are issues with Microsoft extensions, not with vscodium I suggest to create issues there "does not work with vscode open source builds" in those extensions, this may help you more. Note that - as mentioned in the wiki - some LSP explicit are only licensed for Microsoft binaries, so there's no use in complaining (neither here, nor at Microsoft) at all.

Note: I've just just current VSCodium and opened a python file, got LSP features in general (highlighting, syntax checks, structures) and a note "Starting Jedi language server for default." in the logs - but other than pylance possibly would have there is no fancy IntelliCode (the completion is "dumb").

@GitMensch GitMensch changed the title IntelliCode won't work on VSCodium python: IntelliCode won't work on VSCodium Jan 21, 2024
@TechPro424
Copy link

https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright
using this extension and Jedi lang server, the experience has improved a lot
Pylance needs to be uninstalled for this to work

@fithisux
Copy link

fithisux commented Jun 7, 2024

If you use all the ms-python extensions on VSCodium 1.9.0 @cdhainaut (of course select black (I use it) or autopep8 for formatters), cli tools like mypy/pywright/.... and jedi language server on 3.12.3 python on windows, not only everything works fine but it also enforces good programming practices. I'm on Windows x64 10 Pro. I was very pleasantly surprised that all worked that good (some colorization is not there TBH). I also have VSCode for my main work on Python but the experience was day and night vs one year before. I have not yet used python test runner on VSCodium, but I will test more thoroughly.

@GustavoWidman
Copy link

Rolling back Pylance to 2023.6.40 seems to work fine (if you would rather run a year old version of the extension).

Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the stale label Dec 29, 2024
@fithisux
Copy link

Since August I work exlusively with VScodium and jedi server for all my professional work. No issues.

MS extensions, jlatest Jedi server, Python 3.13 on windows 10 x64 and ruff plugin.

@github-actions github-actions bot removed the stale label Dec 30, 2024
@GitMensch
Copy link
Collaborator

Since August I work exlusively with VScodium and jedi server for all my professional work. No issues.

MS extensions, latest Jedi server, Python 3.13 on windows 10 x64 and ruff plugin.

Can you please outline what you had to do? for this setup (apart from the python binaries). Also, what is that plugin for/where it is used (and how installed)?

@fithisux
Copy link

fithisux commented Dec 30, 2024

OK @GitMensch .

First of all I am on Windows 10 x64.

I installed Python 3.13.1 in c:]winoss\python3 and allowed it to be on the path (during installation)
I installed VScodium c:\winoss\vscodium and allowed it to be on the path (during installation)

In Python I installed

pip3 install --upgrade mypy mypy-extensions ruff jedi-language-server

I removed any remnants of previous vscodium extensions (I erased in my user folder the vscodium folder
e.g. c:\Users\VasilisAnagnostopoul.vscode-oss)

I open VScodium

and install

ms-python => Python, Python Debugger , Mypy type checker
charliermarsh => Ruff

And now after close and restart (maybe not required)

File > Preferences > Settings extensions > Python

Language Server > Jedi

File > Preferences > Settings extensions > Ruff

Enable > tick it.

Close VScodium and open it.

Now load your project folder.

Did it work for you?

@GitMensch
Copy link
Collaborator

GitMensch commented Jan 3, 2025

That works fine on "modern" systems (if you don't need mypy you can drop pip3 and any packages from it, as you use the ruff-lsp). For everything that is part of the RedHat8 family (which only distributes python 3.6.8), this setup currently doesn't work. (ref: astral-sh/ruff-vscode#660)

The best option if you want to support these kind of environments is to et ms-python.python 2022.2.1924087327 (providing the internal "python" debugger which works fine).

... and to let this run with current environments, adjust $HOME/.vscodium/extensions/ms-python.python-2022.2.1924087327/pythonFiles/lib/jedilsp/pydantic/utils.py

             # TODO: replace annotation with actual expected types once #1055 solved
-            kwargs = {'default': field.default} if not field.required else {}
-            merged_params[param_name] = Parameter(
-                param_name, Parameter.KEYWORD_ONLY, annotation=field.outer_type_, **kwargs
-            )
+            try:   # added to work around "from is not a valid parameter name"
+                kwargs = {'default': field.default} if not field.required else {}
+                merged_params[param_name] = Parameter(
+                    param_name, Parameter.KEYWORD_ONLY, annotation=field.outer_type_, **kwargs
+                )
+            except:
+                pass

@fithisux
Copy link

fithisux commented Jan 3, 2025

@GitMensch that is unfortunate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants