astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
1.06k stars 53 forks source link

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

Closed omerfarukdogan closed 7 months ago

omerfarukdogan commented 8 months ago

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

charliermarsh commented 8 months ago

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

dhruvmanila commented 7 months ago

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.

taylorhughes commented 7 months ago

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