Skip to content
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

πŸ› Biome suggests "Suppress rule …" above an actual fix #5058

Open
1 of 3 tasks
lgarron opened this issue Jan 29, 2025 · 2 comments
Open
1 of 3 tasks

πŸ› Biome suggests "Suppress rule …" above an actual fix #5058

lgarron opened this issue Jan 29, 2025 · 2 comments
Assignees
Labels
A-LSP Area: language server protocol S-Enhancement Status: Improve an existing feature

Comments

@lgarron
Copy link

lgarron commented Jan 29, 2025

VS Code version

1.96.4

Extension version

2.3.0

Biome version

1.9.3

Operating system

  • Windows
  • macOS
  • Linux

Description

  1. Run:
mkdir /tmp/biome-suggestion-order && cd /tmp/biome-suggestion-order
npm install --save-dev @biomejs/biome
npx @biomejs/biome init
echo "console.log(!!!false);" > index.ts
echo 'console.log("The number is" + 5);' >> index.ts
code /tmp/biome-suggestion-order
  1. Open index.ts and place the cursor over either error.
  2. Invoke "Quick Fix…" using the keyboard shortcut (βŒ₯.).
  3. Press the same keyboard shortcut again to accept the first suggestion.

This results in a biome-ignore comment being added instead of the actual suggested fix.

This is because the "Suppress rule …" option usually shows before the actual fix suggestion:

Image
Image

Steps to reproduce

See above.

Expected behavior

I would find it much more useful if the default suggestion was the actual fix. Due to other UX choices by VS Code, this would be significantly more convenient than if it is the second suggestion (see below).

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Link to a minimal reproduction

See above

Logs


@lgarron
Copy link
Author

lgarron commented Jan 29, 2025

Note that this interacts with #5057

If both are addressed, it would be very easy to review and accept a lot of suggestions quickly (which is often useful when adding/upgrading Biome for a project). I have "Go to Next Problem" bound to ⌘8, so for me this would be:

  • ⌘8 ⌘. ⌘.
  • Repeat for each issue.

This allows keeping one key constantly pressed (⌘) and alternating between only two other keys. Super simple to learn and use!

If the occasional default suggestion is not correct, I can pause between two consecutive ⌘. invocations. And even if I make a mistake, it's easy to go back.

Contrast this to a double workaround, which requires letting go and pressing ⌘ twice for each error and using four additional keys:

  • ⌘8 β†’ ⌘. ↓ ⌘.
  • Repeat for each issue.

I know it sounds a bit picky, but the inputs are precise and I find this kind of keyboard dance very distracting when I'm trying to focus on reviewing linter issues in bulk. It would be really nice the other way!

@nhedger
Copy link
Member

nhedger commented Feb 6, 2025

The extension has no control over the order of these items, they are supplied by the LSP server.

I'll see if this can be addressed in the main repo.

@nhedger nhedger transferred this issue from biomejs/biome-vscode Feb 7, 2025
@ematipico ematipico added the A-LSP Area: language server protocol label Feb 7, 2025
@ematipico ematipico added the S-Enhancement Status: Improve an existing feature label Feb 18, 2025
@ematipico ematipico self-assigned this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LSP Area: language server protocol S-Enhancement Status: Improve an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants