[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 05c68c2 45/69: Don't send dummy JSON object in "i
From: |
João Távora |
Subject: |
[elpa] externals/eglot 05c68c2 45/69: Don't send dummy JSON object in "initialized" notification (#312) |
Date: |
Sun, 20 Oct 2019 08:21:50 -0400 (EDT) |
branch: externals/eglot
commit 05c68c252986cd4c400c313ab38664300e6b93a6
Author: Vladimir Panteleev <address@hidden>
Commit: João Távora <address@hidden>
Don't send dummy JSON object in "initialized" notification (#312)
Eglot uses a JSON object { __dummy__ : true } as a placeholder instead
of the empty object {}. It does this out of necessity, since encoding
an empty object can't currently be easily using the current jsonrpc.el
library. However, this also causes the parameter to be actually sent
to the server.
Since the JSON-RPC specification states "The names MUST match exactly,
including case, to the method's expected parameters" this is
non-conforming to the protocol.
The LSP specification does not seem to indicate how servers should
handle method calls with parameters they do not support. As such,
ignoring the parameter, or reporting an error, or crashing all seem to
be "valid" behaviors as far as the specification is concerned.
We can avoid this by using an empty hash table instead of a dummy
parameter. Currently, an empty hash table is the only Emacs Lisp
object which jsonrpc.el serializes to an empty JSON object in
jsonrpc--json-encode.
* eglot.el (eglot--connect): Use make-hash-table instead of dummy
object.
Copyright-paperwork-exempt: yes
---
eglot.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eglot.el b/eglot.el
index cf2f371..ef7f8f0 100644
--- a/eglot.el
+++ b/eglot.el
@@ -848,7 +848,7 @@ This docstring appeases checkdoc, that's all."
(push server
(gethash project eglot--servers-by-project))
(setf (eglot--capabilities server) capabilities)
- (jsonrpc-notify server :initialized `(:__dummy__ t))
+ (jsonrpc-notify server :initialized
(make-hash-table))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(eglot--maybe-activate-editing-mode server)))
- [elpa] externals/eglot c3bae0a 44/69: New test for the eglot-autoshutdown defcustom, (continued)
- [elpa] externals/eglot c3bae0a 44/69: New test for the eglot-autoshutdown defcustom, João Távora, 2019/10/20
- [elpa] externals/eglot 28d8ffe 48/69: Fix #285: unbreak Elm language server which does use :triggerCharacters, João Távora, 2019/10/20
- [elpa] externals/eglot 06ff65d 52/69: Rework and correct major part of xref glue code, João Távora, 2019/10/20
- [elpa] externals/eglot 9951dc5 62/69: Add a test for vscode-json-languageserver's completions, João Távora, 2019/10/20
- [elpa] externals/eglot 124a833 56/69: Add a test for #311 and #279, João Távora, 2019/10/20
- [elpa] externals/eglot d774754 37/69: Merge pull request #298 from jorams/nil-capabilities-as-false, João Távora, 2019/10/20
- [elpa] externals/eglot 20195e5 42/69: On buffer kill, first send didClose then teardown local structures, João Távora, 2019/10/20
- [elpa] externals/eglot 5a98c5a 55/69: Fix eglot-completion-at-point to work with bare completion-at-point, João Távora, 2019/10/20
- [elpa] externals/eglot 6a7ce66 32/69: Expand directory watcher globs containing ** (#293), João Távora, 2019/10/20
- [elpa] externals/eglot f45fdc6 31/69: Fix invalid guess for php language Server (#288), João Távora, 2019/10/20
- [elpa] externals/eglot 05c68c2 45/69: Don't send dummy JSON object in "initialized" notification (#312),
João Távora <=
- [elpa] externals/eglot bff921e 60/69: Per #319: always filter completions client-side by prefix, João Távora, 2019/10/20
- [elpa] externals/eglot 260f152 65/69: Fix #321: don't choke on single-location reply to tD/definition, João Távora, 2019/10/20
- [elpa] externals/eglot 8a17c29 61/69: Close #235: play along with LSP's filterText hacks, João Távora, 2019/10/20
- [elpa] externals/eglot f5151be 67/69: Don't immediately request completions in eglot-completion-at-point, João Távora, 2019/10/20
- [elpa] externals/eglot 74240c7 66/69: Protect against zero-length completions, João Távora, 2019/10/20