emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs 9ffcd537f8 078/120: Apply any additionaltextedits un


From: João Távora
Subject: feature/eglot2emacs 9ffcd537f8 078/120: Apply any additionaltextedits unconditionally
Date: Thu, 20 Oct 2022 07:16:59 -0400 (EDT)

branch: feature/eglot2emacs
commit 9ffcd537f82ecb05996c49014c5b72009134a927
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Apply any additionaltextedits unconditionally
    
    * eglot.el (eglot-completion-at-point): Apply any
    additionalTextEdits unconditionally.
    
    GitHub-reference: fix https://github.com/joaotavora/eglot/issues/981
---
 lisp/progmodes/eglot.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index b058183fb9..eb5b86ed10 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2698,16 +2698,16 @@ for which LSP on-type-formatting should be requested."
                                        (eglot--range-region range)))
                             (delete-region beg end)
                             (goto-char beg)
-                            (funcall (or snippet-fn #'insert) newText)))
-                        (when (cl-plusp (length additionalTextEdits))
-                          (eglot--apply-text-edits additionalTextEdits)))
+                            (funcall (or snippet-fn #'insert) newText))))
                        (snippet-fn
                         ;; A snippet should be inserted, but using plain
                         ;; `insertText'.  This requires us to delete the
                         ;; whole completion, since `insertText' is the full
                         ;; completion's text.
                         (delete-region (- (point) (length proxy)) (point))
-                        (funcall snippet-fn (or insertText label)))))
+                        (funcall snippet-fn (or insertText label))))
+                 (when (cl-plusp (length additionalTextEdits))
+                   (eglot--apply-text-edits additionalTextEdits)))
                (eglot--signal-textDocument/didChange)
                (eldoc)))))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]