]> 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)
committerJoão Távora <joaotavora@gmail.com>
Tue, 26 Dec 2023 13:54:21 +0000 (07:54 -0600)
commit4dcbf61c1518dc53061707aeff8887517e050003
treee0711ed5270cddd78e99beb668077bad02432680
parent60199ac01d711d3240146afedd830b774eb5c5d2
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.
lisp/progmodes/eglot.el