Skip to content

Commit

Permalink
lsp: Check server provider capabilities (helix-editor#3554)
Browse files Browse the repository at this point in the history
Language Servers may signal that they do not support a method in
the initialization result (server capabilities). We can check these
when making LSP requests and hint in the status line when a method
is not supported by the server. This can also prevent crashes in
servers which assume that clients do not send requests for methods
which are disabled in the server capabilities.

There is an existing pattern the LSP client module where a method
returns `Option<impl Future<Output = Result<_>>>` with `None` signaling
no support in the server. This change extends this pattern to the rest
of the client functions. And we log an error to the statusline for
manually triggered LSP calls which return `None`.
  • Loading branch information
the-mikedavis authored and Shekhinah Memmel committed Dec 11, 2022
1 parent bae460a commit f119507
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 97 deletions.
Loading

0 comments on commit f119507

Please sign in to comment.