aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/completion.lua
diff options
context:
space:
mode:
authorSebastian Lyng Johansen <sebastian@lyngjohansen.com>2024-07-02 18:27:51 +0200
committerGitHub <noreply@github.com>2024-07-02 18:27:51 +0200
commitaec7f1979ada1b34cfb3d8fd33769232d0323ea8 (patch)
tree5004c5ee5ee32617ade3206171088cb14ecffbcd /runtime/lua/vim/lsp/completion.lua
parentcb84cd5d9fbae40313f4fb9fd8bf715511c9ca28 (diff)
downloadrneovim-aec7f1979ada1b34cfb3d8fd33769232d0323ea8.tar.gz
rneovim-aec7f1979ada1b34cfb3d8fd33769232d0323ea8.tar.bz2
rneovim-aec7f1979ada1b34cfb3d8fd33769232d0323ea8.zip
fix(lsp): fallback to `label` for completion items if all others are missing (#29522)
Diffstat (limited to 'runtime/lua/vim/lsp/completion.lua')
-rw-r--r--runtime/lua/vim/lsp/completion.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua
index b935c48d3c..1078e3eb7e 100644
--- a/runtime/lua/vim/lsp/completion.lua
+++ b/runtime/lua/vim/lsp/completion.lua
@@ -176,7 +176,7 @@ local function apply_defaults(item, defaults)
if defaults.editRange then
local textEdit = item.textEdit or {}
item.textEdit = textEdit
- textEdit.newText = textEdit.newText or item.textEditText or item.insertText
+ textEdit.newText = textEdit.newText or item.textEditText or item.insertText or item.label
if defaults.editRange.start then
textEdit.range = textEdit.range or defaults.editRange
elseif defaults.editRange.insert then