Pylance not installed but selected as languageServer causes error and breaks Quick Fix

Describe the Bug

Pylance not working despite python.languageServer set to “Pylance”

Steps to Reproduce

In .vscode/settings.json, I set:

{
  "python.languageServer": "Pylance"
}
However, the Pylance extension is not installed. VSCode shows this prompt:

"The Pylance extension is not installed but the python.languageServer value is set to 'Pylance'. Would you like to install the Pylance extension to use Pylance, or revert back to Jedi?"

As a result, Python Quick Fix (like import suggestions) does not work at all.

Expected:
VSCode should either fallback gracefully or clearly indicate that Pylance is required for Quick Fix features.

Tested on:

Cursor IDE 1.2.1

Python extension installed





### Operating System
Linux

### Current Cursor Version (Menu -> About Cursor -> Copy)
Cursor : 1.2.1
VSCode Version: 1.99.3




### Does this stop you from using Cursor
No - Cursor works, but with this issue

Hi @yunjinchoidev, Pylance is not supported within Cursor. Could you try setting this to “none”, which will allow the Anysphere Python extension to provide the LSP? We don’t support the same quick actions as Pylance – I’d recommend to ask the agent to perform the task if you can’t find an action that you’re looking for.

A month ago, Quick Fix (like auto-import suggestions) was working just fine in Cursor without needing the Pylance extension. I haven’t changed any settings since then, but now it’s suddenly broken. Did something change recently that might have caused this?

Yes – new installations of the MS Python extension will also install the Anysphere Python extension. We made this change recently.

thanks a lot for the clarification and all the work you’re doing on Cursor.

I just wanted to share that for me (and probably many other developers), Quick Fix features like auto-import suggestions are an essential part of daily development.

It used to work well in Cursor, and I really appreciated that convenience. But with the recent changes, it’s now broken, and that’s been a noticeable hit to my productivity.

I truly hope you consider either supporting Pylance or enhancing the Anysphere extension to bring back full Quick Fix support.

I really enjoy using Cursor and would love to keep using it as my main IDE — but this feature feels like a must-have, not a nice-to-have.

Thanks again for your time and continued improvements!

2 Likes

Hi @yunjinchoidev, Quick fix for auto-import is supported. If its not showing up, then the language server might not be configured properly. Does jump-to-definition work, and do you see any errors from the language server? If not, please make sure a Python interpreter is selected.

Hi, thanks for the response.

Jump-to-definition works once the import is resolved, so that part seems fine. However, when I try to run “Restart Language Server”, I get the error:
command 'python.analysis.restartLanguageServer' not found.

I believe this is because my settings.json has "python.languageServer": "None".
When I switch to "Pylance", I get a “revert” error (not sure why).
The Python interpreter is correctly selected, though.

Any idea how I can fix this?

If jump-to-definition is working, then this is likely because of differences in how the auto-import is implemented (especially with aliases or nested imports). Is Cursor Tab able to complete the imports?

You can use the command cursorpyright.restartserver to restart the server; we require that python.languageServer be “None” so that Cursor Python language server can activate.

Thanks for the explanation. Just to clarify — auto-import does work when using the Cursor tab (I can complete imports there), but when I press Cmd + ., I only see the “Fix with AI” option. The list of available imports doesn’t appear like it usually does with Quick Fix.

I see, thanks. It seems like this might be an issue in basedpyright (our extension is forked from this one): Language server does’t offer autocomplete for functions in modules or packages that haven’t been opened or loaded · Issue #545 · DetachHead/basedpyright

When it’s fixed there, we’ll rebase this into our extension.