Python Type Checker Setup (Python Extension / Basepyright)

Hello,

I am trying to configure a type checker for Python in my settings.json. I have tried for a few hours now, read some other forum posts but couldn’t find any solution to my problem.

When I start up Cursor I get this warning “Cursor Pyright changed the setting `python.languageServer` to ‘None’ to prevent conflicts with Jedi and Pylance.”. I am not sure why it is doing that. From my understanding Pylance is not supported anymore so setting the languageServer to Default should use Jedi.

In my settings.json I am using:

    "python.languageServer": "Default",
    "cursorpyright.analysis.typeCheckingMode": "basic",
    "cursorpyright.analysis.diagnosticMode": "workspace",
    "cursorpyright.analysis.autoSearchPaths": true,

But it doesn’t work. It is not scanning the full workspace, only opened files. If I restart Cursor, I get the warning I mentioned. Then it automatically sets the languageServer back to None and the type checker doesn’t work. If I manually set it to Default it is somewhat working but completely ignoring any settings like “python.analysis.diagnosticSeverityOverrides”. Which leads me to the conclusion that my configuration is wrong.

Is there anyone who has had a similar problem before? I am really having a hard time trying to find a good solution and the only option seems like going back to VSCode and using Pylance (which I wouldn’t prefer).

Go back to vscode and drop your Cursor subscription, that’s what I’m doing. Always breaking something.

https://forum.cursor.com/search?q=Pylance%20order%3Alatest

1 Like

Hi @Peter.py,

Yes, we set the language server to “None” so our extension can activate and provide a LSP.

Can you try moving your overrides to the setting cursorpyright.analysis.diagnosticSeverityOverrides?

Hey @ravirahman, I think my text was a bit confusing. I already tried that and also tried removing it but it didn’t help unfortunately.

I‘m having a bit of a hard time debugging my errors to be honest. I just tried again, added a type error to my main.py and got some basedpyright messages in the Problems tab. Also from another file. But it doesn’t seem to check the full workspace. If I open a different file it loads more errors.

If I close all tabs, the problems disappear which makes me think there could be something wrong with my workspace settings. But I am using VSCode with Pyright, same settings (just „python“ instead of „cursorpyright“) and the same project and it works.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.