diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-12-31 06:52:14 -0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-12-31 08:06:48 -0800 |
commit | b112fe828fd2457692f556626d7657615e53cb0b (patch) | |
tree | a113c1e18615e7f7b985266afbcb4d36a4e9e57d /runtime/lua/vim/lsp | |
parent | d839c35871cb8f91705244455676217e0d76980e (diff) | |
download | rneovim-b112fe828fd2457692f556626d7657615e53cb0b.tar.gz rneovim-b112fe828fd2457692f556626d7657615e53cb0b.tar.bz2 rneovim-b112fe828fd2457692f556626d7657615e53cb0b.zip |
gen_vimdoc.py: generate LSP docs
Diffstat (limited to 'runtime/lua/vim/lsp')
-rw-r--r-- | runtime/lua/vim/lsp/protocol.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/rpc.lua | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index ead90cc75a..f64b0b50e7 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -603,6 +603,8 @@ export interface WorkspaceClientCapabilities { } --]=] +--- Gets a new ClientCapabilities object describing the LSP client +--- capabilities. function protocol.make_client_capabilities() return { textDocument = { @@ -821,6 +823,8 @@ interface ServerCapabilities { experimental?: any; } --]] + +--- Creates a normalized object describing LSP server capabilities. function protocol.resolve_capabilities(server_capabilities) local general_properties = {} local text_document_sync_properties diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index 72a0bf8d6f..e13b05610b 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -166,9 +166,14 @@ local function format_rpc_error(err) return table.concat(message_parts, ' ') end +--- Creates an RPC response object/table. +--- +--@param code RPC error code defined in `vim.lsp.protocol.ErrorCodes` +--@param message (optional) arbitrary message to send to server +--@param data (optional) arbitrary data to send to server local function rpc_response_error(code, message, data) -- TODO should this error or just pick a sane error (like InternalError)? - local code_name = assert(protocol.ErrorCodes[code], 'Invalid rpc error code') + local code_name = assert(protocol.ErrorCodes[code], 'Invalid RPC error code') return setmetatable({ code = code; message = message or code_name; |