diff options
Diffstat (limited to 'runtime/doc/lsp.txt')
-rw-r--r-- | runtime/doc/lsp.txt | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 9661a43e4c..82d94afdc8 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -825,7 +825,7 @@ start({config}, {opts}) *vim.lsp.start()* re-uses a client if name and root_dir matches. Return: ~ - (number) client_id + (number|nil) client_id start_client({config}) *vim.lsp.start_client()* Starts and initializes a client with the given configuration. @@ -835,9 +835,16 @@ start_client({config}) *vim.lsp.start_client()* The following parameters describe fields in the {config} table. Parameters: ~ - {cmd} (required, string or list treated like - |jobstart()|) Base command that initiates the LSP - client. + {cmd} (table|string|fun(dispatchers: table):table) + command string or list treated like |jobstart|. + The command must launch the language server + process. `cmd` can also be a function that + creates an RPC client. The function receives a + dispatchers table and must return a table with + the functions `request`, `notify`, `is_closing` + and `terminate` See |vim.lsp.rpc.request| and + |vim.lsp.rpc.notify| For TCP there is a built-in + rpc client factory: |vim.lsp.rpc.connect| {cmd_cwd} (string, default=|getcwd()|) Directory to launch the `cmd` process. Not related to `root_dir`. {cmd_env} (table) Environment flags to pass to the LSP on @@ -1890,6 +1897,17 @@ should_log({level}) *vim.lsp.log.should_log()* ============================================================================== Lua module: vim.lsp.rpc *lsp-rpc* +connect({host}, {port}) *vim.lsp.rpc.connect()* + Create a LSP RPC client factory that connects via TCP to the given host + and port + + Parameters: ~ + {host} (string) + {port} (number) + + Return: ~ + (function) + format_rpc_error({err}) *vim.lsp.rpc.format_rpc_error()* Constructs an error message from an LSP error object. |