How can I prioritize "Add import" over "Ruff: Disable" in Python / VS Code

802 Views Asked by At

I'm writing Python code in VS Code and have recently installed the Ruff linter and its associated VS Code extension. One thing I'm finding frustrating is that when I write a symbol name and want to use VS Code's "Quick Fix" to add an import for it, the first option that comes up is "Ruff: Disable" rather than "Add import".

Quick Fix showing "Ruff: Disable" first and Add import second

This isn't the end of the world, of course, I can press down arrow to select the action I want. But it does add an extra step and is an annoyance. Is there a way I can get these actions in the order I want?

A few versions if they're relevant:

  • Ruff extension, this happens with both v2023.16.0 and v2023.17.11351528
  • Pylance v2023.6.10
  • Python VS Code Extension v2023.8.0

VS Code version:

Version: 1.78.2 (Universal)
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:44:45.204Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.5.0
Sandboxed: Yes
0

There are 0 best solutions below