]> git.eshelyaron.com Git - emacs.git/commit
Eglot: try again to fix try-completion logic
authorJoão Távora <joaotavora@gmail.com>
Mon, 20 Jan 2025 17:23:08 +0000 (17:23 +0000)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 Jan 2025 10:23:02 +0000 (11:23 +0100)
commit72f1ffcf2fd81c2a847b312f477cfc29c1b57bd3
tree531593163e5161e83675d86b9edb17ebee52456f
parenta09940e9f4df4e83b7074e48accdf08423b4296a
Eglot: try again to fix try-completion logic

Emacs partial completion simply doesn't make sense in LSP.
Attempts to make it make some sense end up failing for one
reason or another.

This commit restores the original intention of the
eglot--dumb-allc and eglot--dumb-tryc functions, which was to be
dumb and pop up a *Completions* buffer (or a company tooltip),
as soon as there is doubt over what the user wants to do.

It also fixes tests, including an expensive Rust test that had
been broken for a long time.

* lisp/progmodes/eglot.el (eglot--dumb-allc): Consider point.
(eglot--dumb-tryc): Make it suitably dumb again.

* test/lisp/progmodes/eglot-tests.el
(eglot--wait-for-rust-analyzer): Wait longer.
(eglot-test-common-prefix-completion): Delete this test.  It's not
the intended behavior.
(eglot--kill-completions-buffer): New helper.
(eglot-test-try-completion-nomatch): Rework test.
(eglot-test-try-completion-inside-symbol): Pops *Completions*
buffer because mustn't partial complete.
(eglot-test-try-completion-inside-symbol-2): Does complete.
(eglot-test-rust-completion-exit-function): Fix long-broken test.

(cherry picked from commit 73f51f3a99ed454fa57e5ebe177df00cada1f11a)
lisp/progmodes/eglot.el
test/lisp/progmodes/eglot-tests.el