Closed shapiromatron closed 1 year ago
I think we have this behavior -- if you use fromEnvironment
, then we fallback to the bundled version if we can't find an extension in the workspace:
Can you give that a try and let me know if it works for you (or doesn't)?
(And thank you for the kind words :))
Confirmed, it works brilliantly and as expected. Easy to debug and confirm when I viewed the output terminal vscode:
Using interpreter executable: /Users/me/dev/hawc/venv/bin/ruff
At a minimum, it'd be good to document importStrategy
in the readme, I didn't see this option. I'd be happy to submit a PR with this if you'd like.
An additional step might be to change the default to fromEnvironment
, since that would fall-back to the bundled if one isn't installed, and that's consistent with how the built flake8 vscode python tools appear to work.
Let me know if I should go ahead with the docs change, I'm happy to help, and looking forward to switching all my repos over to ruff.
Yeah those are all good ideas. PRs welcome on any of them! I feel like I used to have importStrategy
on there, but that it got removed.
Oh, probably because I copied this table over from ruff-lsp
, and the underlying LSP doesn't really support fromEnvironment
(it's a VS Code thing)... It looks like it was present in 7431c2e439c38d1ae1f33ac3bfdb4e90adb27652
, but could probably be improved beyond what it used to say there.
Added to docs!
Wow thanks! I had the PR on my list but you beat me too it, thanks again!
The vscode-flake8 extension states:
This is nice behavior; if a team specifies a specific version of flake8, then that's used instead of the version in the extension.
It would be nice if this extension had the same behavior. Right now I guess we could update our developer instructions to set a
path
to a custom version of ruff in work workspace, but if a workspace has a version already installed, it might be a desirable default behavior instead, and is consistent with the flake8 extension.PS - ruff is awesome, nice work!