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 (#2738)
* feat: highlight symbol under cursor using LSP textDocument/documentHighlight * fix: please clippy * fix: shorter description and code style
This commit is contained in:
parent
fde9e034d4
commit
096abdd19b
4 changed files with 65 additions and 0 deletions
helix-lsp/src
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue