-
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
Use ruff.interpreter
from workspace settings
#553
Conversation
6b70a82
to
78dd0ae
Compare
traceLog(`Python extension loaded`); | ||
return; // The `onDidChangePythonInterpreter` event will trigger the server start. | ||
} | ||
} else { | ||
await runServer(); | ||
} | ||
await runServer(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug that would hang the extension when ruff.interpreter
is provided and the workspace is trusted. We would never call the runServer
in that case.
7e25f69
to
dec965c
Compare
Do we need to fall back to the interpreter from the Python extension? |
We do fall back to that, it's just moved to |
dec965c
to
1555057
Compare
Summary
This PR updates the scope of
ruff.interpreter
setting fromwindow
toresource
in order to resolve the variables such as${workspaceFolder}
if present.In #551, what happens is that the Python extension fails to resolve the environment corresponding to that interpreter which causes the hang. The bug present in #551 was there for a very long time but it got visible because of e665ec7. Before that commit, the extension would just move ahead and use the interpreter from the Python extension but now we explicitly stop moving ahead if it fails to resolve the environment corresponding to the interpreter.
For reference, the
vscode-black-formatter
extension also updated the scope ofruff.interpreter
to beresource
in microsoft/vscode-black-formatter@5f2fc61.fixes: #551
Test Plan
Relative paths are unresolved
Logs:
Preview for the status bar:
Using VS Code specific variables
Logs: