vscode-ruff icon indicating copy to clipboard operation
vscode-ruff copied to clipboard

Ruff extension depends on `ms-python.python` breaking non-Pylance LSPs

Open felixm-stripe opened this issue 1 year ago • 3 comments

Hi!

At Stripe we use Ruff to check our code (very happy with the speed, UX, and lints available). However, we also rely on a different LSP to type-check the code properly at scale. That LSP is incompatible with Pylance, and as such, Pylance needs to be disabled.

Since the Ruff extension depends on ms-python.python, and it in turn automatically installs and enables Pylance, our engineers are forced to manually intervene to disable Pylance whenever the Ruff extension gets re-installed / updated. Currently, there's no way to configure banned extensions in VSCode, so we have tooling to instead remove the extensions when we push an update. However, sometimes Ruff gets updated out of band.

Could we remove the reliance on ms-python.python in the Ruff extension?

felixm-stripe avatar Oct 25 '24 07:10 felixm-stripe

Thanks for the kind words!

This is related to https://github.com/astral-sh/ruff-vscode/issues/479

MichaReiser avatar Oct 25 '24 07:10 MichaReiser

Is it possible to use the "python.languageServer": "None" setting? This will at least disable any language server from running via the Python extension.

dhruvmanila avatar Oct 25 '24 08:10 dhruvmanila

It seems that other LSPs like Pyright check if Pylance is enabled and if so turns itself off. I can file an issue there as well, but ultimately, we might need to remove the reliance on the Python extension altogether so while helpful, I think the core issue is still relevant! ☺️

felixm-stripe avatar Oct 25 '24 10:10 felixm-stripe