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.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index 7003ca6f..a7dac5d0 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -364,6 +364,7 @@ impl Client {
| CodeActionProviderCapability::Options(_),
)
),
+ LanguageServerFeature::DocumentLinks => capabilities.document_link_provider.is_some(),
LanguageServerFeature::WorkspaceCommand => {
capabilities.execute_command_provider.is_some()
}
@@ -713,6 +714,10 @@ impl Client {
dynamic_registration: Some(false),
resolve_support: None,
}),
+ document_link: Some(lsp::DocumentLinkClientCapabilities {
+ dynamic_registration: Some(false),
+ tooltip_support: Some(false),
+ }),
call_hierarchy: Some(lsp::DynamicRegistrationClientCapabilities {
dynamic_registration: Some(false),
}),
@@ -1174,6 +1179,35 @@ impl Client {
Some(self.call::<lsp::request::DocumentColor>(params))
}
+ pub fn text_document_document_link(
+ &self,
+ text_document: lsp::TextDocumentIdentifier,
+ work_done_token: Option<lsp::ProgressToken>,
+ ) -> Option<impl Future<Output = Result<Option<Vec<lsp::DocumentLink>>>>> {
+ if !self.supports_feature(LanguageServerFeature::DocumentLinks) {
+ return None;
+ }
+
+ let params = lsp::DocumentLinkParams {
+ text_document,
+ work_done_progress_params: lsp::WorkDoneProgressParams { work_done_token },
+ partial_result_params: lsp::PartialResultParams::default(),
+ };
+
+ Some(self.call::<lsp::request::DocumentLinkRequest>(params))
+ }
+
+ pub fn resolve_document_link(
+ &self,
+ params: lsp::DocumentLink,
+ ) -> Option<impl Future<Output = Result<lsp::DocumentLink>>> {
+ if !self.supports_feature(LanguageServerFeature::DocumentLinks) {
+ return None;
+ }
+
+ Some(self.call::<lsp::request::DocumentLinkResolve>(params))
+ }
+
pub fn text_document_hover(
&self,
text_document: lsp::TextDocumentIdentifier,