1
0
Fork 0
mirror of https://github.com/helix-editor/helix.git synced 2025-04-06 04:17:43 +03:00

feat: highlight / select symbol under cursor using LSP textDocument/documentHighlight ()

* feat: highlight symbol under cursor using LSP textDocument/documentHighlight

* fix: please clippy

* fix: shorter description and code style
This commit is contained in:
lazytanuki 2022-06-27 13:19:56 +02:00 committed by GitHub
parent fde9e034d4
commit 096abdd19b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 0 deletions
helix-lsp/src

View file

@ -759,6 +759,26 @@ impl Client {
Ok(response.unwrap_or_default())
}
pub fn text_document_document_highlight(
&self,
text_document: lsp::TextDocumentIdentifier,
position: lsp::Position,
work_done_token: Option<lsp::ProgressToken>,
) -> impl Future<Output = Result<Value>> {
let params = lsp::DocumentHighlightParams {
text_document_position_params: lsp::TextDocumentPositionParams {
text_document,
position,
},
work_done_progress_params: lsp::WorkDoneProgressParams { work_done_token },
partial_result_params: lsp::PartialResultParams {
partial_result_token: None,
},
};
self.call::<lsp::request::DocumentHighlightRequest>(params)
}
fn goto_request<
T: lsp::request::Request<
Params = lsp::GotoDefinitionParams,