Subject: bug#57725: closed (Re: bug#57725: 29.0.50; eglot: Error when using :initializationOptions)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 17 Sep 2022 16:42:02 +0000

Your bug report

#57725: 29.0.50; eglot: Error when using :initializationOptions

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
57725: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57725
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#57725: 29.0.50; eglot: Error when using :initializationOptions
From: Stefan Kangas <[email-masked]>
To: Augusto Stoffel <[email-masked]>
Cc: "Basil L. Contovounesios" <[email-masked]>, [email-masked],João Távora <[email-masked]>
Date: Sat, 17 Sep 2022 18:41:17 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Augusto Stoffel <[email-masked]> writes:

> Yes, please close this ticket here at the Emacs tracker.

Done.

Subject: 29.0.50; eglot: Error when using :initializationOptions
From: Augusto Stoffel <[email-masked]>
To: [email-masked]
Date: Sun, 11 Sep 2022 09:02:49 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

If I attempt to pass :initializationOptions to a server like so:

    (setf (alist-get 'python-mode eglot-server-programs)
          '("jedi-language-server" :initializationOptions eglot--{}))

I get an error:

    Debugger entered--Lisp error: (invalid-slot-name "#<eglot-lsp-server eglot-lsp-server-92f0c8>" :initializationOptions)

A workaround is to add this to the eglot-lsp-server defclass:

@@ -788,6 +788,7 @@ treated as in `eglot-dbind'."
    (managed-buffers
     :documentation "List of buffers managed by server."
     :accessor eglot--managed-buffers)
+   (_ :initarg :initializationOptions)
    (saved-initargs
     :documentation "Saved initargs for reconnection purposes."
     :accessor eglot--saved-initargs)

I can also confirm that after the workaround, the options are passed
correctly to the server upon initialization.