diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-03-20 17:51:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-20 17:51:56 -0700 |
commit | e5bef5974e900001cb6ed302b39a6f5ddf48d9a4 (patch) | |
tree | ad275a839e07c7ca5ee81f413f7d3ab4baed2fda /runtime/lua/vim/lsp/util.lua | |
parent | dc8da7ba40feac55d383bfca5fe69d1f63e5abf1 (diff) | |
parent | 24ad2c70677235c3f498b18425c2f378e0aa1421 (diff) | |
download | rneovim-e5bef5974e900001cb6ed302b39a6f5ddf48d9a4.tar.gz rneovim-e5bef5974e900001cb6ed302b39a6f5ddf48d9a4.tar.bz2 rneovim-e5bef5974e900001cb6ed302b39a6f5ddf48d9a4.zip |
Merge pull request #14171 from vrischmann/insert-text-empty
runtime/lua/vim/lsp: check emptyness in get_completion_word
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 5c139253ee..a75ab37508 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -518,13 +518,13 @@ end --- precedence is as follows: textEdit.newText > insertText > label --@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion local function get_completion_word(item) - if item.textEdit ~= nil and item.textEdit.newText ~= nil then + if item.textEdit ~= nil and item.textEdit.newText ~= nil and item.textEdit.newText ~= "" then if protocol.InsertTextFormat[item.insertTextFormat] == "PlainText" then return item.textEdit.newText else return M.parse_snippet(item.textEdit.newText) end - elseif item.insertText ~= nil then + elseif item.insertText ~= nil and item.insertText ~= "" then if protocol.InsertTextFormat[item.insertTextFormat] == "PlainText" then return item.insertText else |