Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-lsp/src/client.rs')
| -rw-r--r-- | helix-lsp/src/client.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index e5a116d7..f2b78a11 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -356,6 +356,7 @@ impl Client { capabilities.inlay_hint_provider, Some(OneOf::Left(true) | OneOf::Right(InlayHintServerCapabilities::Options(_))) ), + LanguageServerFeature::DocumentColors => capabilities.color_provider.is_some(), } } @@ -1095,6 +1096,25 @@ impl Client { Some(self.call::<lsp::request::InlayHintRequest>(params)) } + pub fn text_document_document_color( + &self, + text_document: lsp::TextDocumentIdentifier, + work_done_token: Option<lsp::ProgressToken>, + ) -> Option<impl Future<Output = Result<Vec<lsp::ColorInformation>>>> { + self.capabilities.get().unwrap().color_provider.as_ref()?; + let params = lsp::DocumentColorParams { + text_document, + work_done_progress_params: lsp::WorkDoneProgressParams { + work_done_token: work_done_token.clone(), + }, + partial_result_params: helix_lsp_types::PartialResultParams { + partial_result_token: work_done_token, + }, + }; + + Some(self.call::<lsp::request::DocumentColor>(params)) + } + pub fn text_document_hover( &self, text_document: lsp::TextDocumentIdentifier, |