diff options
author | Matouš Dzivjak | 2024-01-17 17:24:38 +0000 |
---|---|---|
committer | GitHub | 2024-01-17 17:24:38 +0000 |
commit | c60ba4ba04de56f37f4f4b19051bc4a1e68b3484 (patch) | |
tree | 724199349f239b9c646bc26639c60cbe18eb9b1b /helix-lsp | |
parent | 6754acd83ff0f6edf837611679c5f4424e14492e (diff) |
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 <mcarsondavis@gmail.com>
Diffstat (limited to 'helix-lsp')
-rw-r--r-- | helix-lsp/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |