emacs-diffs
[Top][All Lists]
Advanced

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

feature/eglot2emacs 4beab004d9 070/120: Ensure exit-function of eglot-c-


From: João Távora
Subject: feature/eglot2emacs 4beab004d9 070/120: Ensure exit-function of eglot-c-at-point runs on exact match
Date: Thu, 20 Oct 2022 07:16:57 -0400 (EDT)

branch: feature/eglot2emacs
commit 4beab004d98f17f830600b4597315f030a7313c3
Author: rbrtb <104695105+rbrtb@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Ensure exit-function of eglot-c-at-point runs on exact match
    
    When the completion is exact match, exit-function should still run.
    
    Say one is using auto-imports feature of pyright.  One types foo, and
    triggers the completion.  There are two candidates: foo and foo_bar.  If
    one chooses foo, the status would be 'exact' instead of 'finished', thus
    exit-function is not executed, foo is not auto-imported.
    
    * eglot.el (eglot-completion-at-point): Consider 'exact status.
    
    Copyright-paperwork-exempt: Yes
    GitHub-reference: fix https://github.com/joaotavora/eglot/issues/941
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 3d1b19c905..81c545e64f 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2649,7 +2649,7 @@ for which LSP on-type-formatting should be requested."
             (line-beginning-position))))
        :exit-function
        (lambda (proxy status)
-         (when (eq status 'finished)
+         (when (memq status '(finished exact))
            ;; To assist in using this whole `completion-at-point'
            ;; function inside `completion-in-region', ensure the exit
            ;; function runs in the buffer where the completion was



reply via email to

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