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

Send active diagnostics to LSP when requesting code actions. #2005

Merged
merged 2 commits into from
Apr 17, 2022
Merged

Send active diagnostics to LSP when requesting code actions. #2005

merged 2 commits into from
Apr 17, 2022

Conversation

RobinJadoul
Copy link
Contributor

This allows for e.g. clangd to properly send the quickfix code actions corresponding to those diagnostics as options.
The LSP spec v3.16.0 introduced an opaque data member that would allow the server to persist arbitrary data between the diagnostic and the code actions request, but this is not supported yet by this commit.

This allows for e.g. clangd to properly send the quickfix code actions
corresponding to those diagnostics as options.
The LSP spec v3.16.0 introduced an opaque `data` member that would allow
the server to persist arbitrary data between the diagnostic and the code
actions request, but this is not supported yet by this commit.
Comment on lines 80 to 83
lsp::Range::new(
pos_to_lsp_pos(doc, diag.range.start, offset_encoding),
pos_to_lsp_pos(doc, diag.range.end, offset_encoding),
),
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That takes a helix_core::selection::Range whereas the diagnostics have their own helix_core::diagnostic::Range.
So either this was an option, or you'd need to construct the regular Range first.

@archseer archseer merged commit 33b7483 into helix-editor:master Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants