aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src
diff options
context:
space:
mode:
authorlazytanuki2022-06-27 11:19:56 +0000
committerGitHub2022-06-27 11:19:56 +0000
commit096abdd19bb422cba607d43d05b195b37a7f95e9 (patch)
tree6c958977196fdad8d090d1962f862464d7e107eb /helix-lsp/src
parentfde9e034d4a7bd16d3c9780600874323e4e91628 (diff)
feat: highlight / select symbol under cursor using LSP textDocument/documentHighlight (#2738)
* feat: highlight symbol under cursor using LSP textDocument/documentHighlight * fix: please clippy * fix: shorter description and code style
Diffstat (limited to 'helix-lsp/src')
-rw-r--r--helix-lsp/src/client.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index cf6706b5..aa833541 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -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,