aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorRom Grk <romgrk.cc@gmail.com>2020-11-03 03:11:08 -0500
committerRom Grk <romgrk.cc@gmail.com>2020-11-03 03:11:08 -0500
commit13e0ca3e194a438383b8451e19090355aa6c29dc (patch)
tree0ac33ef5ac829b7c74dd15f34b17540c3186c356 /runtime/lua/vim/lsp/util.lua
parentc7c865214655f7d88fde85ed4947f07319c14182 (diff)
parent5b5848f2fb1f4b7995bb8a59d94b6766d2182070 (diff)
downloadrneovim-13e0ca3e194a438383b8451e19090355aa6c29dc.tar.gz
rneovim-13e0ca3e194a438383b8451e19090355aa6c29dc.tar.bz2
rneovim-13e0ca3e194a438383b8451e19090355aa6c29dc.zip
Merge branch 'master' into add-scroll-events
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua17
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index b5f171a985..9ed19b938d 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -214,13 +214,16 @@ end
function M.apply_text_document_edit(text_document_edit)
local text_document = text_document_edit.textDocument
local bufnr = vim.uri_to_bufnr(text_document.uri)
- if text_document.version then
- -- `VersionedTextDocumentIdentifier`s version may be null https://microsoft.github.io/language-server-protocol/specification#versionedTextDocumentIdentifier
- if text_document.version ~= vim.NIL and M.buf_versions[bufnr] ~= nil and M.buf_versions[bufnr] > text_document.version then
- print("Buffer ", text_document.uri, " newer than edits.")
- return
- end
+
+ -- `VersionedTextDocumentIdentifier`s version may be null
+ -- https://microsoft.github.io/language-server-protocol/specification#versionedTextDocumentIdentifier
+ if text_document.version
+ and M.buf_versions[bufnr]
+ and M.buf_versions[bufnr] > text_document.version then
+ print("Buffer ", text_document.uri, " newer than edits.")
+ return
end
+
M.apply_text_edits(text_document_edit.edits, bufnr)
end
@@ -532,7 +535,7 @@ function M.convert_signature_help_to_markdown_lines(signature_help)
}
--]=]
-- TODO highlight parameter
- if parameter.documentation and parameter.documentation ~= vim.NIL then
+ if parameter.documentation then
M.convert_input_to_markdown_lines(parameter.documentation, contents)
end
end