astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Disable for this line" appears before auto-imports in Quick Fix menu

omerfarukdogan opened this issue · comments

I have noticed that ruff suggestions sometimes appear before the auto-import actions in the quick fix menu. It would be better if they appeared below them as disabling the rule would be the least favorable action in case of a missing import.

thumbnail_image003

Unfortunately I'm not sure whether we can control this, since the Add "..." actions come from another extension.

There have been some requests on the VS Code side to solve this but they're all closed:

This is how VS Code sorts them: https://github.com/microsoft/vscode/blob/a8f73340be02966c3816a2f23cb7e446a3a7cb9b/src/vs/editor/contrib/codeAction/browser/codeAction.ts#L40-L63.

If you don't find this specific type of code action useful ("Disable this rule for the line"), you can disable them with "codeAction.disableRuleComment.enable": false (https://github.com/astral-sh/ruff-vscode#settings).

I'll close this issue as I don't think we can take any action from our side to resolve this.

Had the same problem — "codeAction.disableRuleComment.enable": false resolved this for me