From c60ba4ba04de56f37f4f4b19051bc4a1e68b3484 Mon Sep 17 00:00:00 2001 From: Matouš Dzivjak Date: Wed, 17 Jan 2024 17:24:38 +0000 Subject: feat(lsp): implement show document request (#8865) * feat(lsp): implement show document request Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument) LSP server-sent request. This PR builds on top of helix-editor#5820, moves the external-URL opening functionality into shared crate-level function that returns a callback that is now used by both the `open_file` command as well as the window.showDocument handler if the URL is marked as external. * add return * use vertical split * refactor --------- Co-authored-by: Michael Davis --- helix-lsp/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'helix-lsp') diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 34278cd5..83625897 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -549,6 +549,7 @@ pub enum MethodCall { WorkspaceConfiguration(lsp::ConfigurationParams), RegisterCapability(lsp::RegistrationParams), UnregisterCapability(lsp::UnregistrationParams), + ShowDocument(lsp::ShowDocumentParams), } impl MethodCall { @@ -576,6 +577,10 @@ impl MethodCall { let params: lsp::UnregistrationParams = params.parse()?; Self::UnregisterCapability(params) } + lsp::request::ShowDocument::METHOD => { + let params: lsp::ShowDocumentParams = params.parse()?; + Self::ShowDocument(params) + } _ => { return Err(Error::Unhandled); } -- cgit v1.2.3-70-g09d2