aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
diff options
context:
space:
mode:
authorPatrice Peterson <patrice.peterson@mailbox.org>2020-08-19 18:17:08 +0200
committerPatrice Peterson <patrice.peterson@mailbox.org>2020-08-23 13:48:25 +0200
commitac05343a1023874243ee9fdd490c21c42a737157 (patch)
tree2466eb3c28b09b8e77ba7e1d3696555672fbb38e /runtime/lua/vim/lsp/protocol.lua
parent8c49e3d50959e24dadd688f56a18f104bd5fd934 (diff)
downloadrneovim-ac05343a1023874243ee9fdd490c21c42a737157.tar.gz
rneovim-ac05343a1023874243ee9fdd490c21c42a737157.tar.bz2
rneovim-ac05343a1023874243ee9fdd490c21c42a737157.zip
Add docs for most vim.lsp methods
Most of the lsp.log will be addressed in a separate PR.
Diffstat (limited to 'runtime/lua/vim/lsp/protocol.lua')
-rw-r--r--runtime/lua/vim/lsp/protocol.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index ef5e08680e..4e926381e0 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -2,6 +2,11 @@
local protocol = {}
+--@private
+--- Returns {a} if it is not nil, otherwise returns {b}.
+---
+--@param a
+--@param b
local function ifnil(a, b)
if a == nil then return b end
return a
@@ -9,12 +14,14 @@ end
--[=[
--- Useful for interfacing with:
--- https://github.com/microsoft/language-server-protocol/raw/gh-pages/_specifications/specification-3-14.md
+--@private
+--- Useful for interfacing with:
+--- https://github.com/microsoft/language-server-protocol/raw/gh-pages/_specifications/specification-3-14.md
function transform_schema_comments()
nvim.command [[silent! '<,'>g/\/\*\*\|\*\/\|^$/d]]
nvim.command [[silent! '<,'>s/^\(\s*\) \* \=\(.*\)/\1--\2/]]
end
+--@private
function transform_schema_to_table()
transform_schema_comments()
nvim.command [[silent! '<,'>s/: \S\+//]]