-
Notifications
You must be signed in to change notification settings - Fork 53
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
VS Code setting ruff.interpreter does no longer accept relative paths #551
Comments
Neither does the following setting work:
|
Thanks, will fix! |
I am surprised that |
Can you tell me which language server are you using? Are you using the native server or I'm asking because there shouldn't be any change if you're using If it's the native server then I think it might be related to e1777e1 or 564a37a because earlier we would just pass the interpreter path as ruff-vscode/src/common/server.ts Lines 210 to 263 in 7896831
|
We have to expand |
Me too. I expected that this should not make a difference for ruff, if I enter the absolute path or if I use the ${workspaceFolder}.
For the VS Code extension I have the following settings:
|
I think I see at least the non-expansion issue. |
@dhruvmanila - Do you want to take it? |
Yeah, I can take it on. |
Thanks. We probably need to expand relative paths too before passing to |
I think there might be a bigger issue here. We do resolve the variables but only when it's a workspace setting: ruff-vscode/src/common/settings.ts Line 139 in 7896831
And, we don't resolve any variables for the global settings: ruff-vscode/src/common/settings.ts Lines 183 to 223 in 7896831
Which, I guess, makes sense because it's not tied to any specific workspace. Black doesn't seem to be resolving the variables from global settings either: |
Ok, I can reproduce this, let me check what's actually going on. |
I found the problem, it's bug I introduced in 4b03f7c |
Hi @ni-co-la, can you try out the pre-release version which contains the bug fix. You can go to the Ruff extension page and click on "Switch to Pre-Release Version": |
I just tested it with the pre-release version and it is working fine with
Which is fine for me, as it is more explicit to use the Thanks a lot for the fix. |
Thanks for testing it!
Yes, I explicitly decided not to support this. It wasn't working before either, and you'll probably get the same log messages as in the PR description for earlier versions. It's just that a recent change (e665ec7) made it explicitly visible by removing an unintended fall back mechanism. I'll make a stable release later today. |
With the latest version of the VS Code extension (v2024.34.0 and v2024.32.0), relative paths for "ruff.interpreter" are no longer accepted (in .vscode/settings.json).
In our repository, this settings file is shared between for all developers and it points to the venv Python installation inside the repository.
For example:
This was working just fine in previous versions and is still working fine with other extension like pylint and flake8.
Output:
Setup:
The text was updated successfully, but these errors were encountered: