[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 856a224 62/69: Simplify jsonrpc-connection-send
From: |
João Távora |
Subject: |
[elpa] externals/eglot 856a224 62/69: Simplify jsonrpc-connection-send |
Date: |
Fri, 22 Jun 2018 11:55:05 -0400 (EDT) |
branch: externals/eglot
commit 856a22431522c5df8269e3f6b7f345edd6d1e54e
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Simplify jsonrpc-connection-send
* jsonrpc.el (jsonrpc-connection-send): Use args.
---
jsonrpc.el | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/jsonrpc.el b/jsonrpc.el
index cec16b7..f063870 100644
--- a/jsonrpc.el
+++ b/jsonrpc.el
@@ -421,27 +421,22 @@ connection object, called when the process dies .")
(cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection)
&rest args
&key
- id
+ _id
method
- params
- result
- error)
+ _params
+ _result
+ _error
+ _partial)
"Send MESSAGE, a JSON object, to CONNECTION."
- (let* ((method
- (cond ((keywordp method)
- (substring (symbol-name method) 1))
- ((and method (symbolp method)) (symbol-name method))
- (t method)))
- (message `(:jsonrpc "2.0"
- ,@(when method `(:method ,method))
- ,@(when id `(:id ,id))
- ,@(when params `(:params ,params))
- ,@(when result `(:result ,result))
- ,@(when error `(:error ,error))))
- (json (jsonrpc--json-encode message))
- (headers
- `(("Content-Length" . ,(format "%d" (string-bytes json)))
- ("Content-Type" . "application/vscode-jsonrpc; charset=utf-8"))))
+ (plist-put args :method
+ (cond ((keywordp method) (substring (symbol-name method) 1))
+ ((and method (symbolp method)) (symbol-name method))
+ (t method)))
+ (let* ( (message `(:jsonrpc "2.0" ,@args))
+ (json (jsonrpc--json-encode message))
+ (headers
+ `(("Content-Length" . ,(format "%d" (string-bytes json)))
+ ("Content-Type" . "application/vscode-jsonrpc; charset=utf-8"))))
(process-send-string
(jsonrpc--process connection)
(cl-loop for (header . value) in headers
- [elpa] externals/eglot 2da7d92 50/69: Simplify JSONRPC status setting, (continued)
- [elpa] externals/eglot 2da7d92 50/69: Simplify JSONRPC status setting, João Távora, 2018/06/22
- [elpa] externals/eglot 69a622a 64/69: Fix some typos, João Távora, 2018/06/22
- [elpa] externals/eglot 7371f68 57/69: * jsonrpc.el: Rewrite commentary., João Távora, 2018/06/22
- [elpa] externals/eglot 6531c8b 58/69: Merge branch 'master' into jsonrpc-refactor, João Távora, 2018/06/22
- [elpa] externals/eglot 59cc3fb 61/69: jsonrpc-connection-receive is now a public convenience function, João Távora, 2018/06/22
- [elpa] externals/eglot d371f05 49/69: Request dispatcher's return value determines response, João Távora, 2018/06/22
- [elpa] externals/eglot 0f20fdf 68/69: Tiny README.md change, João Távora, 2018/06/22
- [elpa] externals/eglot cef3c29 22/69: Heroically merge master into jsonrpc-refactor (using imerge), João Távora, 2018/06/22
- [elpa] externals/eglot a4441c6 37/69: Merge master into jsonrpc-refactor (using imerge), João Távora, 2018/06/22
- [elpa] externals/eglot 0e44b27 27/69: jsonrpc.el uses classes and generic functions, João Távora, 2018/06/22
- [elpa] externals/eglot 856a224 62/69: Simplify jsonrpc-connection-send,
João Távora <=
- [elpa] externals/eglot 1f09fd3 59/69: Review commentary section before another review cycle, João Távora, 2018/06/22
- [elpa] externals/eglot 8fda30c 67/69: Merge master into jsonrpc-refactor (using imerge), João Távora, 2018/06/22
- [elpa] externals/eglot 7f4e273 31/69: Merge master into jsonrpc-refactor (using imerge), João Távora, 2018/06/22
- [elpa] externals/eglot 4525eca 43/69: Support json.c. API purely based on classes, João Távora, 2018/06/22
- [elpa] externals/eglot bb60c0c 21/69: Rename jrpc.el to jsonrpc.el, João Távora, 2018/06/22
- [elpa] externals/eglot 46e6107 54/69: Reshuffle definitions inside jsonrpc.el, João Távora, 2018/06/22
- [elpa] externals/eglot 6f1ecc6 28/69: Merge branch use-eieio-server-defclass into jsonrpc-refactor, João Távora, 2018/06/22
- [elpa] externals/eglot 10559a5 56/69: Shuffle definitions around again, João Távora, 2018/06/22
- [elpa] externals/eglot b3c8b59 02/69: Refactor JSON-RPC lib jrpc.el from eglot.el, João Távora, 2018/06/22
- [elpa] externals/eglot 1ec47fb 51/69: Remove connection grabbing antics from jsonrpc.el, João Távora, 2018/06/22