-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ruff server
setting enabling code actions on save
#11756
Comments
Thanks for opening this feature request, @DanCardin! I do think this would a setting worth exploring for editors that don't have a way to run code actions / commands on save.
Just to clarify - are you also proposing that we introduce a separate setting to enable running |
Per my parenthesis block in the OP, i'd personally be happy with an But with that said, I could imagine (by looking at astral-sh/ruff-lsp#335) that someone might also want to enable |
Okay, thanks for clarifying 👍 |
Another usecase at here is you always trigger format action manually and you didn't set code actions on save. I usually organize imports, format, and fix violations after I complemented the source of target module. Proposalruff serverEditor settings: {
"ruff.format.action": {
"fix": true,
"isort": true,
"style": true,
}
}
ruff cliThe Ruff CLI needs further discussion around new command (e.g. |
In the PR for adding the organizeImports code action, i saw a reference to:
which, as far as i can tell, is a VSCode specific thing. Per astral-sh/ruff-lsp#409 or astral-sh/ruff-lsp#335, I'd love for there to be a
ruff server
-specific setting that optionally enables either/or both oforganizeImports
orfixAll
actions on lsp format.Personally, I'd likely enable just the
organizeImports
on save (which i see no reason ever to not run, which is why i'd rather have it automatic than a code action i need to remember to perform), perhaps not fixAll.The text was updated successfully, but these errors were encountered: