]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "Eglot: Make 'try-completion' less broken"
authorJoão Távora <joaotavora@gmail.com>
Tue, 26 Dec 2023 14:10:04 +0000 (08:10 -0600)
committerJoão Távora <joaotavora@gmail.com>
Tue, 26 Dec 2023 16:10:14 +0000 (10:10 -0600)
This reverts commit 4dcbf61c1518dc53061707aeff8887517e050003.

It's not correct, breaks tests.  I declare it impossible to make C-M-i
use of 'try-completion' behave sanely with LSP in its current state.
YMMV.  Use a completion tooltip, like Company.

lisp/progmodes/eglot.el

index a97c9e2a3e086f8ff75ebb0d01940074b8fc3045..d777e488c4350a99b16ea295b55af840c98fb7b9 100644 (file)
@@ -3113,8 +3113,8 @@ for which LSP on-type-formatting should be requested."
           ((eq action 'lambda)                           ; test-completion
            (test-completion pattern (funcall proxies)))
           ((eq (car-safe action) 'boundaries) nil)       ; boundaries
-          ((null action)                                 ; try-completion (github#1339)
-           pattern)
+          ((null action)                                 ; try-completion
+           (try-completion pattern (funcall proxies)))
           ((eq action t)                                 ; all-completions
            (let ((comps (funcall proxies)))
              (dolist (c comps) (eglot--dumb-flex pattern c t))
@@ -3215,8 +3215,7 @@ for which LSP on-type-formatting should be requested."
                         ;; was obtained from server. If a `proxy'
                         ;; "bar" was obtained from a buffer with
                         ;; "foo.b", the LSP edit applies to that
-                        ;; state, _not_ the current "foo.bar"
-                        ;; (github#1339)
+                        ;; state, _not_ the current "foo.bar".
                         (delete-region orig-pos (point))
                         (insert (substring bounds-string (- orig-pos (car bounds))))
                         (eglot--dbind ((TextEdit) range newText) textEdit