biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
14.47k stars 451 forks source link

šŸ› Biome LSP does not announce the `quickfix.suppressRule` code action to a client #4116

Open vitallium opened 2 hours ago

vitallium commented 2 hours ago

Environment information

CLI:
  Version:                      1.9.2
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.17.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

  1. When Biome LSP sends its capabilities back to the client, it doesn't send the quickfix.suppressRule code action among the default code actions: quickfix.biome, source.fixAll.biome and source.organizeImports.biome`.
  2. Without that capability the client does not know that this code action is available on the server side.

How to reproduce:

  1. Install the Zed editor and the Biome extension
  2. Create a simple Typescript file with the following content:
let hello;
  1. You should see the reported linting error from Biome LSP, but if you click on the available code actions, the quickfix.suppressRule option will be missing.

See also https://github.com/microsoft/vscode-eslint/issues/1905#issuecomment-2258655707

Thanks! Let me know if you need anything else.

Expected result

The Biome LSP should send all possible code actions to a client to ensure that:

  1. The client knows about possible code actions
  2. The client does not send an invalid code action to a server.

Code of Conduct

ematipico commented 2 hours ago

Not a bug, because we don't handle that yet.

PRs are welcome

vitallium commented 2 hours ago

Not a bug, because we don't handle that yet.

PRs are welcome

@ematipico Hi, thanks for the quick reply! Iā€™m happy to contribute, but Iā€™d like to know if you have anything specific in mind for the implementation, or should I just send a PR and we can iterate from there? Thanks again.