Expand description
§LSP handlers — one module per capability
Every module here has the same two jobs:
1. a handler function with the signature the dispatch table calls:
request: async fn(ServerContextSnapshot, Params, CancellationToken) -> RequestOutcome<Result>
notification: async fn(ServerContextSnapshot, Params) -> Option<()>
2. a `RegisterCapabilities` implementation, which is what the server advertises in `initialize`Both are wired in two places and nowhere else: [request_handler] / [notification_handler] for the
dispatch, and the capabilities! table at the bottom of this file for what the client is told. A module
that is in one and not the other is a handler the client will never call (or a capability with no
implementation), so the two lists are read together
The table below is deliberately short: it is the set of capabilities this server answers today. Adding
one is three edits — the module, the dispatch row, the capability row — and the modules that were removed
from the Lua skeleton (semantic_token, signature_help, …) come back the same way: completion,
document_symbol, folding_range, references, rename, selection_range, workspace_symbol and
inlay_hint all came back that way.
Modules§
- call_
hierarchy textDocument/prepareCallHierarchyand its two follow-ups — who calls this, and what it calls.- diagnostic
- Diagnostics — what the analysis reported about one file
- hover
textDocument/hover— what the name under the cursor is- implementation
textDocument/implementation— the classes and functions that implement a declaration- references
textDocument/references— where else this name is written
Structs§
- Client
Config - What the client told this server about how to analyse the workspace.
Traits§
- Register
Capabilities - What a module has to answer to be advertised in
initialize.
Functions§
- initialized_
handler - on_
notification_ handler - on_
request_ handler - on_
response_ handler - process_
did_ change_ text_ document - process_
did_ change_ watched_ files - process_
did_ close_ document - process_
did_ open_ text_ document - process_
did_ save_ text_ document - A save is a statement that the buffer and the disk now agree.
- read_
the_ modules - The module interface units this file imports, read in — the half of “read the file in first” that a project scan cannot do.
- register_
files_ watch - server_
capabilities - start_
analysis - Open the analysis over the workspace and start reading it.