branch: externals/elpa commit e7a43e28eddef3e923942699bb30b7bc7e1480fc Author: Gary Oberbrunner <ga...@oberbrunner.com> Commit: João Távora <joaotav...@gmail.com>
Fix #480: also consider label of a CompletionItem for snippets Copyright-paperwork-exempt: yes * eglot.el (eglot-completion-at-point): Consider label when expanding snippets. --- eglot.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eglot.el b/eglot.el index cc60290..fe8eeee 100644 --- a/eglot.el +++ b/eglot.el @@ -2152,9 +2152,7 @@ is not active." :exit-function (lambda (proxy _status) (eglot--dbind ((CompletionItem) insertTextFormat - insertText - textEdit - additionalTextEdits) + insertText textEdit additionalTextEdits label) (funcall resolve-maybe (or (get-text-property 0 'eglot--lsp-item proxy) @@ -2189,7 +2187,7 @@ is not active." ;; whole completion, since `insertText' is the full ;; completion's text. (delete-region (- (point) (length proxy)) (point)) - (funcall snippet-fn insertText)))) + (funcall snippet-fn (or insertText label))))) (eglot--signal-textDocument/didChange) (eglot-eldoc-function)))))))