vim.lsp.rpc
Methods4
function M.format_rpc_error(err: table) -> error_message string
Constructs an error message from an LSP error object.
errtableThe error object
error_messagestringThe formatted error message
function M.rpc_response_error(code: integer, message: nil | string, data: any) -> lsp.ResponseError
Creates an RPC response table error to be sent to the LSP response.
codeintegerRPC error code defined, see
vim.lsp.protocol.ErrorCodesmessagenil | stringarbitrary message to send to server
dataanyarbitrary data to send to server
lsp.ErrorCodes See vim.lsp.protocol.ErrorCodes
function M.connect(host_or_path: string, port: nil | integer) -> fun(dispatchers: vim.lsp.rpc.Dispatchers) -> vim.lsp.rpc.Client
Create a LSP RPC client factory that connects to either:
- a named pipe (windows)
- a domain socket (unix)
- a host and port via TCP
Return a function that can be passed to the cmd field for |vim.lsp.start()|.
host_or_pathstringhost to connect to or path to a pipe/domain socket
portnil | integerTCP port to connect to. If absent the first argument must be a pipe
- fun(dispatchers: vim.lsp.rpc.Dispatchers) -> vim.lsp.rpc.Client
function M.start(cmd: string[], dispatchers: vim.lsp.rpc.Dispatchers | nil, extra_spawn_params: vim.net.transport.ExtraSpawnParams | nil) -> vim.lsp.rpc.Client
Starts an LSP server process and create an LSP RPC client object to interact with it. Communication with the spawned process happens via stdio. For communication via TCP, spawn a process manually and use |vim.lsp.rpc.connect()|
cmdstring[]Command to start the LSP server.
dispatchersvim.lsp.rpc.Dispatchers | nilextra_spawn_paramsvim.net.transport.ExtraSpawnParams | nil
Fields1
M.client_errors : {string, integer} | {integer, string}
@nodoc