1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Unbreak Eglot, Jsonrpc as EIEIO inches closer to CLOS (bug#67480)

EIEIO is an innacurate emulation of CLOS in many aspects and one of
them in accessor definition.  Before this commit

commit 6c47931a1a
Author: Brandon <brandon.irizarry@gmail.com>
Date:   Sat Nov 4 17:11:32 2023 -0400

    Make EIEIO ':accessor' behave like ':reader' when reading (bug#66938)

An :initform-less, non-:initarg'ed slot with be read using an
:accessor which would just return nil.  This is EIEIO specific of
course, but it made for (my) sloppy programming in jsonrpc.el and
eglot.el.

Tightening up the rules a bit meant these things broke and now I'm
fixing them.

* lisp/jsonrpc.el (jsonrpc-connection): Add a bunch of :initform nil
(jsonrpc-process-connection): Add a bunch of :initform nil

* lisp/progmodes/eglot.el (eglot-lsp-server): Add a bunch of :initform nil
This commit is contained in:
João Távora 2023-11-28 18:33:09 -06:00
parent 7a5c91a283
commit 02d88e36e9
2 changed files with 8 additions and 0 deletions

View file

@ -64,6 +64,7 @@
:initarg :notification-dispatcher :initarg :notification-dispatcher
:documentation "Dispatcher for remotely invoked notifications.") :documentation "Dispatcher for remotely invoked notifications.")
(last-error (last-error
:initform nil
:accessor jsonrpc-last-error :accessor jsonrpc-last-error
:documentation "Last JSONRPC error message received from endpoint.") :documentation "Last JSONRPC error message received from endpoint.")
(-request-continuations (-request-continuations
@ -71,6 +72,7 @@
:accessor jsonrpc--request-continuations :accessor jsonrpc--request-continuations
:documentation "A hash table of request ID to continuation lambdas.") :documentation "A hash table of request ID to continuation lambdas.")
(-events-buffer (-events-buffer
:initform nil
:accessor jsonrpc--events-buffer :accessor jsonrpc--events-buffer
:documentation "A buffer pretty-printing the JSONRPC events") :documentation "A buffer pretty-printing the JSONRPC events")
(-events-buffer-scrollback-size (-events-buffer-scrollback-size
@ -353,6 +355,7 @@ ignored."
:initarg :process :accessor jsonrpc--process :initarg :process :accessor jsonrpc--process
:documentation "Process object wrapped by the this connection.") :documentation "Process object wrapped by the this connection.")
(-expected-bytes (-expected-bytes
:initform nil
:accessor jsonrpc--expected-bytes :accessor jsonrpc--expected-bytes
:documentation "How many bytes declared by server.") :documentation "How many bytes declared by server.")
(-on-shutdown (-on-shutdown

View file

@ -977,15 +977,19 @@ ACTION is an LSP object of either `CodeAction' or `Command' type."
:accessor eglot--project-nickname :accessor eglot--project-nickname
:reader eglot-project-nickname) :reader eglot-project-nickname)
(languages (languages
:initform nil
:documentation "Alist ((MODE . LANGUAGE-ID-STRING)...) of managed languages." :documentation "Alist ((MODE . LANGUAGE-ID-STRING)...) of managed languages."
:accessor eglot--languages) :accessor eglot--languages)
(capabilities (capabilities
:initform nil
:documentation "JSON object containing server capabilities." :documentation "JSON object containing server capabilities."
:accessor eglot--capabilities) :accessor eglot--capabilities)
(server-info (server-info
:initform nil
:documentation "JSON object containing server info." :documentation "JSON object containing server info."
:accessor eglot--server-info) :accessor eglot--server-info)
(shutdown-requested (shutdown-requested
:initform nil
:documentation "Flag set when server is shutting down." :documentation "Flag set when server is shutting down."
:accessor eglot--shutdown-requested) :accessor eglot--shutdown-requested)
(project (project
@ -1002,6 +1006,7 @@ ACTION is an LSP object of either `CodeAction' or `Command' type."
:documentation "Map (DIR -> (WATCH ID1 ID2...)) for `didChangeWatchedFiles'." :documentation "Map (DIR -> (WATCH ID1 ID2...)) for `didChangeWatchedFiles'."
:initform (make-hash-table :test #'equal) :accessor eglot--file-watches) :initform (make-hash-table :test #'equal) :accessor eglot--file-watches)
(managed-buffers (managed-buffers
:initform nil
:documentation "List of buffers managed by server." :documentation "List of buffers managed by server."
:accessor eglot--managed-buffers) :accessor eglot--managed-buffers)
(saved-initargs (saved-initargs