Skip to content

Do not bail code action resolution when a quick fix is requested#12462

Merged
dhruvmanila merged 1 commit intoastral-sh:mainfrom
osiewicz:code-action-resolve-quick-fix-noop
Jul 23, 2024
Merged

Do not bail code action resolution when a quick fix is requested#12462
dhruvmanila merged 1 commit intoastral-sh:mainfrom
osiewicz:code-action-resolve-quick-fix-noop

Conversation

@osiewicz
Copy link
Copy Markdown
Contributor

@osiewicz osiewicz commented Jul 22, 2024

Summary

When working on improving Ruff integration with Zed I noticed that it errors out when we try to resolve a code action of a QUICKFIX kind; apparently, per @dhruvmanila we shouldn't need to resolve it, as the edit is provided in the initial response for the code action. However, it's possible for the resolve call to fill out other fields (such as command).
AFAICT Helix also tries to resolve the code actions unconditionally (as in, when either edit or command is absent); so does VSC. They can still apply the quickfixes though, as they do not error out on a failed call to resolve code actions - Zed does. Following suit on Zed's side does not cut it though, as we still get a log request from Ruff for that failure (which is surfaced in the UI).
There are also other language servers (such as rust-analyzer) that fill out both command and edit fields as a part of code action resolution.

This PR makes the resolve calls for quickfix actions return the input value.

Test Plan

N/A

@charliermarsh
Copy link
Copy Markdown
Member

Thanks! Assigning to @dhruvmanila.

@charliermarsh charliermarsh added the server Related to the LSP server label Jul 22, 2024
Copy link
Copy Markdown
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhruvmanila dhruvmanila changed the title ruff_server: Do not bail code action resolution when a quick fix is requested Do not bail code action resolution when a quick fix is requested Jul 23, 2024
@dhruvmanila dhruvmanila merged commit 143e172 into astral-sh:main Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants