From ddadd03eb9848d281c584eda8b001fd639a95ffd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Magnus=20Gro=C3=9F?= Date: Mon, 4 Sep 2023 20:16:43 +0200 Subject: [PATCH] Fix additionalTextEdits being ignored Regression was introduced in 6f4fdc7bcc3a1ba041c6196b85b506bd0c207cf0. The logic was still fine if the LSP server delayed the additionalTextEdits field, but if we already got it, we ended up ignoring it. Fix this by checking for additionalTextEdits outside the delayed-resolve condition. Also see #389 --- autoload/lsp/completion.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index 0d64e2b..1fa85e2 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -591,9 +591,9 @@ def LspCompleteDone(bnr: number) # additional text edits. So try to resolve the completion item now to get # the text edits. completionData = lspserver.resolveCompletion(completionData, true) - if !completionData->get('additionalTextEdits', {})->empty() - textedit.ApplyTextEdits(bnr, completionData.additionalTextEdits) - endif + endif + if !completionData->get('additionalTextEdits', {})->empty() + textedit.ApplyTextEdits(bnr, completionData.additionalTextEdits) endif if completionData->has_key('command') -- 2.48.1