You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to suggest that code action ordering be kept consistent. For example, in Neovim I have <leader>ca bound to toggling code actions, so it would be helpful if <leader>ca 2 always selected "Organize imports":
On line with no diagnostics: On line with diagnostics:
Ideally, 1 and 2 would select the same thing in both cases since those options are always available.
Thank you!
The text was updated successfully, but these errors were encountered:
Thank you for the suggestion! For discussion around the current ordering, refer to astral-sh/ruff-lsp#210.
The code actions that you've mentioned are the source level code actions i.e., they apply to an entire file. Currently, Ruff always provide the said code actions even if they're no-op but that could change in the future (astral-sh/ruff-lsp#91). For example, the Ruff: Organize imports action won't be provided if there are no imports to organize.
I would instead suggest to use a keybinding if you always need to execute a specific source code action. For example, the following will apply the Ruff: Organize imports code actions:
Ah, that looks good thank you! I might even modify that for use as a BufWritePre autocommand so I don't have to worry about organizing them by hand. And yeah, I see the benefits of the other approach too given the example in astral-sh/ruff-lsp#210.
Hello,
I wanted to suggest that code action ordering be kept consistent. For example, in Neovim I have
<leader>ca
bound to toggling code actions, so it would be helpful if<leader>ca 2
always selected "Organize imports":On line with no diagnostics:
On line with diagnostics:
Ideally,
1
and2
would select the same thing in both cases since those options are always available.Thank you!
The text was updated successfully, but these errors were encountered: