A JSON-RPC server implementing the client side of the Language Server Protocol.
This API is intended for GUIs, which is why incoming LSP notifications have synchronous event handlers rather than virtual async methods.
- protected virtual async ApplyWorkspaceEditResult apply_workspace_edit_async (WorkspaceEdit edit, string? label = null) throws Error
The workspace/applyEdit request is sent from the server to the client
to apply a workspace edit.
- protected override void client_accepted (Client client)
- protected override void client_closed (Client client)
- public async void close_text_document_async (Uri uri) throws Error
Closes a file, sending the `textDocument/didClose` message to the
language server. If the file is not open, this does nothing.
- public async Action[]? code_action_async (Uri uri, Range range, CodeActionTriggerKind trigger = UNSET, CodeActionKind[]? only = null) throws Error
The code action request is sent from the client to the server to
compute commands for a given text document and range. These commands are typically code fixes to either fix problems or to
beautify/refactor code. The result of a textDocument/codeAction request is an array of Command literals which are typically presented
in the user interface. To ensure that a server is useful in many clients the commands specified in a code actions should be handled by
the server and not by the client (see workspace/executeCommand and ServerCapabilities.executeCommandProvider). If the client supports
providing edits with a code action then that mode should be used.
- public async CodeLens[]? code_lens_async (Uri uri) throws Error
The code lens request is sent from the client to the server to compute
code lenses for a given text document.
- public async CompletionItem[]? completion_async (Uri uri, Position position, CompletionContext? context = null) throws Error
The completion request is sent from the client to the server to
compute completion items at a given cursor position.
- public async Location[]? declaration_async (Uri uri, Position position) throws Error
The go-to-declaration request is sent from the client to the server to
resolve the declaration location for a symbol at a given text document position.
- public async Location[]? definition_async (Uri uri, Position position) throws Error
The go-to-definition request is sent from the client to the server to
resolve the definition location for a symbol at a given text document position.
- public async DocumentHighlight[]? document_highlight_async (Uri uri, Position position) throws Error
The document highlight request is sent from the client to the server
to resolve document highlights for a given text document position.
- public async DocumentSymbolResult? document_symbol_async (Uri uri) throws Error
The document symbol request is sent from the client to the server to
return all symbols found in a given text document.
- public async void edit_text_document_async (Uri uri, int64 version, TextDocumentContentChangeEvent[] content_changes) throws Error
The document change notification is sent from the client to the server
to signal changes to a text document. Before a client can change a text document it must claim ownership of its content using the
`textDocument/didOpen` notification (see open_text_document_async
). In 2.0 the shape of the params has changed to include proper version numbers.
- public async void exit_async () throws Error
Notifies the server to exit after shutdown.
- public async TextEdit[]? formatting_async (Uri uri, FormattingOptions options) throws Error
The document formatting request is sent from the client to the server
to format a whole document.
- public async Hover? hover_async (Uri uri, Position position) throws Error
The hover request is sent from the client to the server to request
hover information at a given text document position.
- public async Location[]? implementation_async (Uri uri, Position position) throws Error
The go-to-implementation request is sent from the client to the server
to resolve the implementation location for a symbol at a given text document position.
- public async CallHierarchyIncomingCall[]? incoming_calls_async (CallHierarchyItem item) throws Error
The incoming calls request is sent from the client to the server to
resolve incoming calls for a given call hierarchy item.
- public async void initialize_async (WorkspaceFolder primary_workspace, (unowned WorkspaceFolder)[]? secondary_workspaces = null) throws Error
Initializes the server, if we're connected to one.
- public async void initialize_with_params_async (InitializeParams init_params) throws Error
Initializes the server with caller-provided protocol parameters.
- public async void initialized_async () throws Error
Notifies the server that initialization has completed.
- public async InlayHint[]? inlay_hint_async (Uri uri, Range range) throws Error
The inlay hint request is sent from the client to the server to
resolve inlay hints for a given text document range.
- public async InlayHint? inlay_hint_resolve_async (InlayHint hint) throws Error
The inlay hint resolve request is sent from the client to the server
to resolve additional information for a given inlay hint.
- protected override void notification (Client client, string method, Variant parameters)
- public async void open_text_document_async (Uri uri, LanguageId language_id, string? text = null) throws Error
Opens a file, sending the `textDocument/didOpen` message to the
language server. If the file is already open, this does nothing.
- public async CallHierarchyOutgoingCall[]? outgoing_calls_async (CallHierarchyItem item) throws Error
The outgoing calls request is sent from the client to the server to
resolve outgoing calls for a given call hierarchy item.
- public async CallHierarchyItem[]? prepare_call_hierarchy_async (Uri uri, Position position) throws Error
The prepare call hierarchy request is sent from the client to the
server to prepare a call hierarchy for a symbol at a given text document position.
- public async PrepareRenameResult? prepare_rename_async (Uri uri, Position position) throws Error
The prepare rename request is sent from the client to the server to
check whether a rename is valid at the given position.
- public async TypeHierarchyItem[]? prepare_type_hierarchy_async (Uri uri, Position position) throws Error
Prepares a type hierarchy at a document position.
- public async TextEdit[]? range_formatting_async (Uri uri, Range range, FormattingOptions options) throws Error
The document range formatting request is sent from the client to the
server to format a given range in a document.
- public async Location[]? references_async (Uri uri, Position position, ReferenceContext context) throws Error
The references request is sent from the client to the server to
resolve project-wide references for the symbol denoted by the given text document position.
- public async WorkspaceEdit? rename_async (Uri uri, Position position, string new_name) throws Error
The rename request is sent from the client to the server to rename a
symbol.
- public async void save_text_document_async (Uri uri, string? text = null) throws Error
Notifies the server that an open document was saved.
- public async void set_trace_async (TraceValue trace_value) throws Error
A notification that should be used by the client to modify the trace
setting of the server.
- protected virtual async bool show_document_async (Uri uri, bool external, bool take_focus, Range? selection) throws Error
Shows a server-provided resource in the editor.
- protected virtual async MessageActionItem? show_message_request_async (MessageType type, string message, MessageActionItem[] actions) throws Error
Asks the user to select an action for a server-provided message.
- public async void shutdown_async () throws Error
Requests an orderly server shutdown without terminating it.
- public async SignatureHelp? signature_help_async (Uri uri, Position position) throws Error
The signature help request is sent from the client to the server to
request signature information at a given cursor position.
- public async TypeHierarchyItem[]? type_hierarchy_subtypes_async (TypeHierarchyItem item) throws Error
Resolves direct subtypes for a type hierarchy item.
- public async TypeHierarchyItem[]? type_hierarchy_supertypes_async (TypeHierarchyItem item) throws Error
Resolves direct supertypes for a type hierarchy item.
- public async SymbolInformation[]? workspace_symbol_async (string query) throws Error
The workspace symbol request is sent from the client to the server to
list project-wide symbols matching a given query string.