How to switch vscode to use pylance rather than jedi?

Question:

I am trying to use match/case from python 3.10, but jedi doesn’t support the syntax. I’ve heard pylance is better, but I can’t find any way to switch vscode to pylance. I’ve downloaded the default Python extension, but only the jedi language server is running. How can I make the switch?

EDIT: Adding a picture of trying to search for "pylance" so there’s no confusion, it’s not there at all. It seems to claim it’s part of the python extension, but the language server being used is always jedi.
enter image description here

Python extension packs:
enter image description here

Asked By: Marcus Hagberg

||

Answers:

Change the setting: python.languageServer

Answered By: rioV8

I was using the open source version of vscode which doesn’t have all extensions. Switching to the proprietary version (available on the AUR) fixed my issue.

Answered By: Marcus Hagberg

Go to Settings > Extensions > Python, head down to Language Server and change Default to Pylance.
This fix also works in the Open Source version, VS Codium. It should have nothing to do with the version of VScode you’re using.

Answered By: liambaumann