emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/jsonrpc-support-dap 232b785e766 1/4: Jsonrpc: allow methods iden


From: João Távora
Subject: feature/jsonrpc-support-dap 232b785e766 1/4: Jsonrpc: allow methods identifiers to be simply strings
Date: Sun, 10 Dec 2023 21:09:34 -0500 (EST)

branch: feature/jsonrpc-support-dap
commit 232b785e766f8f8eb0518d54a5670c6362be55d9
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Jsonrpc: allow methods identifiers to be simply strings
    
    * lisp/jsonrpc.el (jsonrpc-connection-send): Support string methods.
---
 lisp/jsonrpc.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 849a8d8eaee..2036e135f52 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -443,7 +443,9 @@ connection object, called when the process dies.")
   (when method
     (plist-put args :method
                (cond ((keywordp method) (substring (symbol-name method) 1))
-                     ((and method (symbolp method)) (symbol-name method)))))
+                     ((symbolp method) (symbol-name method))
+                     ((stringp method) method)
+                     (t (error "[jsonrpc] invalid method %s" method)))))
   (let* ( (message `(:jsonrpc "2.0" ,@args))
           (json (jsonrpc--json-encode message))
           (headers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]