]> git.eshelyaron.com Git - emacs.git/commit
Eglot: Make 'try-completion' less broken
authorJoão Távora <joaotavora@gmail.com>
Tue, 26 Dec 2023 13:47:29 +0000 (07:47 -0600)
committerEshel Yaron <me@eshelyaron.com>
Tue, 26 Dec 2023 15:17:50 +0000 (16:17 +0100)
commitd495cbf0d0103b93e7b3653224e7e260790f98bb
treeed8e1dc6e6b24db54c2b8f8c01fc4ba6461fe091
parent67701641de1eb4555d81634c8e6b9a8d0a86d6c0
Eglot: Make 'try-completion' less broken

The 'try-completion' completion operation, used mostly in vanilla
'completion-at-point' invoked with C-M-i is close to impossible to get
right in LSP because of the arbitrary edits handled in
':exit-function'.

When this operation is invoked on the table, returning the pattern
argument unchanged somehow (TM) makes a sole completion show the
*Completions* buffer, where selecting it will recover context
necessary for `:exit-function' and call that function.  It doesn't
break any other cases I know, and that's good enough for now.

https://github.com/joaotavora/eglot/issues/1339

* lisp/progmodes/eglot.el (eglot-completion-at-point): Return pattern
when 'try-completion' is invoked.

(cherry picked from commit 4dcbf61c1518dc53061707aeff8887517e050003)
lisp/progmodes/eglot.el