]> git.eshelyaron.com Git - emacs.git/commit
Allow :initializationoptions in eglot-server-programs
authorJoão Távora <joaotavora@gmail.com>
Sat, 17 Sep 2022 20:40:34 +0000 (21:40 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sat, 17 Sep 2022 23:40:21 +0000 (00:40 +0100)
commit523547321e4caca6fc966bd71ecd7b60a6e98f73
treee1c274d1a75d506cdd27148ffc940f6b37a5d3e0
parentbef332a98314c5cbd76cce79ee0a60cb6aa94172
Allow :initializationoptions in eglot-server-programs

Also see https://github.com/joaotavora/eglot/issues/1038.

This feature was poorly tested, and simply wouldn't work when trying
to initialize the server object.

The simple solution is to ignore :initializationOptions initarg in
this context.  It is still stored separately as and accessed as the
'eglot--saved-initargs' slot.

Another complication arises in eglot--guess-contact, which tried too
hard to be able to compose an interactive prompt (when the server
program can't be found).  The solution is just to give up when
:autoport or :initializationOptions is found.  It's not easy or
practical to have the user provide non-string arguments via a string
interface like the minibuffer.

* eglot.el (initialize-instance :before eglot-lsp-server): Don't pass
:initializationOptions initarg onward.
(eglot--guess-contact): Simplify.  Don't try heroics with
:autoport and :initializationOptions.

* eglot-tests.el (eglot-server-programs-simple-missing-executable):
  Update test.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/940
lisp/progmodes/eglot.el