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

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

Merged

Conversation

osiewicz
Copy link
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
Member

Thanks! Assigning to @dhruvmanila.

@charliermarsh charliermarsh added the server Related to the LSP server label Jul 22, 2024
Copy link
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
20 checks passed
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