-
Notifications
You must be signed in to change notification settings - Fork 46
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
Prefer interpreter's Ruff to environment's Ruff #83
Conversation
Hi, @charliermarsh Starting with ruff-lsp I have a question, Is it correct that I am using Vim/Neovim, and the |
Hi, @rchl Does the |
Oh weird, I mean this definitely changed, but I wouldn't have expected it to break anything, since in both cases, we're only returning a valid path to Ruff (we just now prefer the activate interpreter's Ruff over a global Ruff). What behavior are you seeing? |
The current behavior is that the ruff command installed with the ruff-lsp dependency is used. |
I debugged it in code and it seems to match this conditional branch. |
Mmm, yeah, I can see why that wouldn't work when We might want to have separate logic for VS Code vs. other LSPs. Or we might want to have three settings here: |
Thanks for the explanation about VS Code and importStrategy. In the meantime, the problem I have will be addressed with a patch on the language client and related plugins side. |
We haven't yet updated to the latest |
@rchl Thank you for the confirmation and explanation in My problem is that the default for ruff-lsp is to use the ruff command installed with the ruf-lsp dependency, but since A use case is to create a virtual environment as a project, and if the ruff command exists in that virtual environment, the ruff command will be used. However, since I asked this question because I thought that something else (importStrategy) might need to be adjusted with this change. |
Sublime Text takes a fairly simplistic approach of always running ruff-lsp and ruff from a separate environment because it's not really possible to activate project's own python environment reliably as in ST all windows share same process and thus system environment. So changing PATH (for example) in one window would affect all other windows and projects. So the fact that it doesn't have issue with this change might be a factor of its limitations. |
See: astral-sh/ruff-vscode#141.