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 Code Completion not working #940

Closed
2 tasks done
fmotaf opened this issue Dec 12, 2021 · 7 comments
Closed
2 tasks done

Python Code Completion not working #940

fmotaf opened this issue Dec 12, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@fmotaf
Copy link

fmotaf commented Dec 12, 2021

Describe the bug
Python code completion don't work in VSCodium as it works out of the box in the proprietary editor.

Please confirm that this problem is VSCodium-specific

  • This bug doesn't happen if I use Microsoft's Visual Studio Code. It only happens in VSCodium.

Please confirm that the issue/resolution isn't already documented

To Reproduce
Steps to reproduce the behavior:
In any python code try to get the suggestions by pressing Ctrl+Space, none shows

Expected behavior
It should be able to show me some code suggestions (auto-complete)

Screenshots

vscodiumbug

My product.json

{
  "extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items",
    "controlUrl": "",
    "recommendationsUrl": ""
  },
  "extensionAllowedProposedApi": [
    "ms-python.python"
    // ...
  ], 
}

Previously i did setup Jedi instead of PyLance as language server, as suggested by @clayrisser here: #892
and my settings.json had these lines:

{
    "enableJedi": true,
    "python.languageServer": "Jedi",
    "python.formatting.provider": "autopep8"
}

besides the default ones obviously, but i don't remember if the update broke it or not, not sure tbh, but it stopped working so i removed these lines trying to make it work after i modified settings.

Also, already added

"nameShort": "Visual Studio Code",
"nameLong": "Visual Studio Code",

to product.json as suggested in #935 , still, not working.

Desktop (please complete the following information):

  • OS: [Pop!_OS 21.04]
  • Architecture [x.64]
  • Version [1.63.0]

Additional context
Happy to help, just tell me what i need to do.

@asdorsey
Copy link

I was having issues with the Microsoft Python extension today (can't install PyLance without hacks on VSCodium, and Jedi doesn't support Python 3.10 syntax yet). I found another solution that doesn't require hacking VSCodium config files.

Uninstall the Microsoft Python extension and install the Pyright extension instead. It's still Microsoft, but it provides auto-completion and error checking, and works on VSCodium out of the box without modification.

I know this doesn't solve your problem exactly, but I hope that it may help you get code completion working in VSCodium.

@AminGholizad
Copy link

I have the same problem and unfortunately I had to switch back to vs code 😞

@bxff
Copy link

bxff commented Dec 8, 2022

Yeah I had the same issue, took me 4 hours but I found a good solution.

The problem is that Pylance is closed source code so VSCodium doesn't allow it. Also Pylance licence may not prohibit it to run inside VSCodium, though I cannot say for sure: https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license

@asdorsey solution works partially but it doesn't work inside Jupyter, and also misses a lot of functionality of Pylance I'd avoid if I can.

Though if you want to still install Pylance you can do so this way, the only downside is it doesn't update on its own, and you'd need to update it from time to time:

  • Install Python extensions like Python, Jupyter as you do in general in VSCodium,
  • Install Pylance by downloading the extensions *.vsix(Download Extention),
  • Change the setting Python: Language Server from default to Pylance

Screenshot 2022-12-08 at 8 33 25 AM

Screenshot 2022-12-08 at 8 37 36 AM

@AminGholizad

@RoyiAvital
Copy link

@bxff , Will PyLance be updated automatically once it is installed that way?

@GitMensch
Copy link
Collaborator

GitMensch commented Mar 2, 2023

Will PyLance be updated automatically once it is installed that way?

... just reading the post you reference and see:

the only downside is it doesn't update on its own, and you'd need to update it from time to time

... explanation: vscode doesn't update anything that was installed from vsix, so it won't here either.
Pylance isn't open source so it isn't on open-vsx (the default marketplace setup in VSCodium and most other vscode based [web] editors) - the only option would be to switch the marketplace, too, via product json. (I'm leaving the license problems out here, as that problem is identical to the Pylance one "only be used with Microsoft Products", you should be aware of this in both cases)

... but then: if you want to use the MS marketplace and MS proprietary extensions you may be better off with their Visual Studio Code binaries (and disable telemetry via settings) - if they provide binaries for your OS. This at least solves the license issues and brings in automatic updates for the extension.

@daiyam
Copy link
Member

daiyam commented Mar 2, 2023

To manage VSIX from different marketplaces, you can use https://open-vsx.org/extension/zokugun/vsix-manager
But it will be up to you to test if the VSIX are compatible with your editor.

@GitMensch
Copy link
Collaborator

Can we close this as unplanned - because we just can't do anything about this as it is an external extension 1 that works out of the box but doesn't work as extension 2 that wants itself only be used in Visual Studio Code (o "of course there is a different result").

@GitMensch GitMensch closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants