;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307\310\311!\"\210\306\312\313\311!\"\210\306\314\312\"\210\315\314\316\317#\210\320\311\321\312#\322\311\323\324\325$\210\326\327\323\330\323\331%\210\326\332\323\333\323\334%\210\326\335\323\336\323\337%\210\326\340\323\341\323\342%\210\326\343\323\344\323\345%\210\326\346\323\347\323\350%\210\326\351\323\352\323\353%\210\326\354\323\355\323\356%\210\326\357\323\360\323\361%\210\326\362\323\363\323\364%\210\326\365\323\366\323\367%\210\326\370\323\371\323\372%\210\326\373\323\374\323\375%\210\326\376\323\377\323\201@%\210\326\201A\323\201B\323\201C%\210\326\201D\323\201E\323\201F%\210\326\201G\323\201H\323\201I%\210\326\201J\323\201K\323\201L%\207" [require cl-lib eieio warnings pcase ert defalias jsonrpc-connection-p eieio-make-class-predicate jsonrpc-connection jsonrpc-connection--eieio-childp eieio-make-child-predicate jsonrpc-connection-child-p make-obsolete "use (cl-typep ... \\='jsonrpc-connection) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal nil ((name :accessor jsonrpc-name :initarg :name :documentation "A name for the connection") (-request-dispatcher :accessor jsonrpc--request-dispatcher :initform #'ignore :initarg :request-dispatcher :documentation "Dispatcher for remotely invoked requests.") (-notification-dispatcher :accessor jsonrpc--notification-dispatcher :initform #'ignore :initarg :notification-dispatcher :documentation "Dispatcher for remotely invoked notifications.") (last-error :accessor jsonrpc-last-error :documentation "Last JSONRPC error message received from endpoint.") (-request-continuations :initform (make-hash-table) :accessor jsonrpc--request-continuations :documentation "A hash table of request ID to continuation lambdas.") (-events-buffer :accessor jsonrpc--events-buffer :documentation "A buffer pretty-printing the JSONRPC events") (-events-buffer-scrollback-size :initarg :events-buffer-scrollback-size :accessor jsonrpc--events-buffer-scrollback-size :documentation "Max size of events buffer. 0 disables, nil means infinite.") (-deferred-actions :initform (make-hash-table :test #'equal) :accessor jsonrpc--deferred-actions :documentation "Map (DEFERRED BUF) to (FN TIMER ID). FN isa saved DEFERRED `async-request' from BUF, to be sent not laterthan TIMER as ID.") (-next-request-id :initform 0 :accessor jsonrpc--next-request-id :documentation "Next number used for a request")) (:documentation "Base class representing a JSONRPC connection.\nThe following initargs are accepted:\n\n:NAME (mandatory), a string naming the connection\n\n:REQUEST-DISPATCHER (optional), a function of three\narguments (CONN METHOD PARAMS) for handling JSONRPC requests.\nCONN is a `jsonrpc-connection' object, method is a symbol, and\nPARAMS is a plist representing a JSON object. The function is\nexpected to return a JSONRPC result, a plist of (:result\nRESULT) or signal an error of type `jsonrpc-error'.\n\n:NOTIFICATION-DISPATCHER (optional), a function of three\narguments (CONN METHOD PARAMS) for handling JSONRPC\nnotifications. CONN, METHOD and PARAMS are the same as in\n:REQUEST-DISPATCHER.") cl-generic-define-method jsonrpc--next-request-id ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -next-request-id eieio-oref] 4 "Retrieve the slot `-next-request-id' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--next-request-id\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -next-request-id] 6 "\n\n(fn VALUE THIS)"] jsonrpc--deferred-actions ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -deferred-actions eieio-oref] 4 "Retrieve the slot `-deferred-actions' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--deferred-actions\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -deferred-actions] 6 "\n\n(fn VALUE THIS)"] jsonrpc--events-buffer-scrollback-size ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -events-buffer-scrollback-size eieio-oref] 4 "Retrieve the slot `-events-buffer-scrollback-size' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--events-buffer-scrollback-size\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -events-buffer-scrollback-size] 6 "\n\n(fn VALUE THIS)"] jsonrpc--events-buffer ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -events-buffer eieio-oref] 4 "Retrieve the slot `-events-buffer' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--events-buffer\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -events-buffer] 6 "\n\n(fn VALUE THIS)"] jsonrpc--request-continuations ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -request-continuations eieio-oref] 4 "Retrieve the slot `-request-continuations' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--request-continuations\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -request-continuations] 6 "\n\n(fn VALUE THIS)"] jsonrpc-last-error ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp last-error eieio-oref] 4 "Retrieve the slot `last-error' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc-last-error\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset last-error] 6 "\n\n(fn VALUE THIS)"] jsonrpc--notification-dispatcher ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -notification-dispatcher eieio-oref] 4 "Retrieve the slot `-notification-dispatcher' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--notification-dispatcher\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -notification-dispatcher] 6 "\n\n(fn VALUE THIS)"] jsonrpc--request-dispatcher ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -request-dispatcher eieio-oref] 4 "Retrieve the slot `-request-dispatcher' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--request-dispatcher\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset -request-dispatcher] 6 "\n\n(fn VALUE THIS)"] jsonrpc-name ((this jsonrpc-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp name eieio-oref] 4 "Retrieve the slot `name' from an object of class `jsonrpc-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc-name\) (value (this jsonrpc-connection)) #[514 "\300\301#\207" [eieio-oset name] 6 "\n\n(fn VALUE THIS)"]] 7) #@75 Create a new object of class type `jsonrpc-connection'. (fn &rest SLOTS) (defalias 'jsonrpc-connection #[128 "\300\301\302#\207" [apply make-instance jsonrpc-connection] 5 (#$ . 7149)]) (byte-code "\300\301\302\303#\300\207" [function-put jsonrpc-connection compiler-macro jsonrpc-connection--anon-cmacro] 4) #@26 (fn WHOLE &rest SLOTS) (defalias 'jsonrpc-connection--anon-cmacro #[385 "\211@;\204\207\300\301\302@@#@\303@DABB\"\207" [macroexp--warn-and-return format "Obsolete name arg %S to constructor %S" identity] 7 (#$ . 7466)]) (byte-code "\300\301\302\301\303\304#\305#\210\300\306\302\306\307\304#\310#\210\300\311\302\311\312\304#\313#\210\300\314\302\314\315\304#\316#\210\317\314\304\320\304\321%\207" [defalias jsonrpc-connection-send cl-generic-define (conn &key id method params result error) nil "Send a JSONRPC message to connection CONN.\nID, METHOD, PARAMS, RESULT and ERROR.\n\n(fn CONN &key ID METHOD PARAMS RESULT ERROR)" jsonrpc-shutdown (conn) "Shutdown the JSONRPC connection CONN.\n\n(fn CONN)" jsonrpc-running-p (conn) "Tell if the JSONRPC connection CONN is still running.\n\n(fn CONN)" jsonrpc-connection-ready-p (connection what) "Tell if CONNECTION is ready for WHAT in current buffer.\nIf it isn't, a request which was passed a value to the\n`:deferred' keyword argument will be deferred to the future.\nWHAT is whatever was passed the as the value to that argument.\n\nBy default, all connections are ready for sending all requests\nimmediately.\n\n(fn CONNECTION WHAT)" cl-generic-define-method (_s _what) #[514 "\300\207" [t] 3 "\n\n(fn S WHAT)"]] 6) #@34 (fn CL-LAMBDA-LIST &body BODY) (defalias 'jsonrpc-lambda '(macro . #[385 "\300\301!\302C\303\304\302BBDEE\207" [cl-gensym "jsonrpc-lambda-elem" lambda apply cl-function] 10 (#$ . 8754)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put jsonrpc-lambda lisp-indent-function 1 put edebug-form-spec (sexp &rest form)] 5) #@70 Get or create JSONRPC events buffer for CONNECTION. (fn CONNECTION) (defalias 'jsonrpc-events-buffer #[257 "\300!\301!\203 \211\206+\302\303\304\305!\"!r\211q\210\306 \210\307\310!\210\311\"\266)\211\262\207" [jsonrpc--events-buffer buffer-live-p get-buffer-create format "*%s events*" jsonrpc-name buffer-disable-undo read-only-mode t \(setf\ jsonrpc--events-buffer\)] 7 (#$ . 9103)]) #@82 Stop waiting for responses from the current JSONRPC CONNECTION. (fn CONNECTION) (defalias 'jsonrpc-forget-pending-continuations #[257 "\300\301!!\207" [clrhash jsonrpc--request-continuations] 4 (#$ . 9506)]) #@163 Process MESSAGE just received from CONNECTION. This function will destructure MESSAGE and call the appropriate dispatcher in CONNECTION. (fn CONNECTION MESSAGE) (defalias 'jsonrpc-connection-receive #[514 "\211\301\302\"A@\301\303\"A@\301\304\"A@\301\305\"A@\301\306\"A@\301\307\"A@\211\203S\211@\310>\203;\211AA\262\202(\311>A@\203J\312\262\202(\313\314@\"\210\202(\210\312\315\n\n\316#\210 \317\"\266\203\301\203\301\205v\320 ?\3211\260\3221\222\306\323 ! \324\n!#D0\202\254\304\325\326\327A\"\206\235\330\331\326\332A\"\206\250\333FD\2620\202\263\334\262\335\336\f $\210)\210\202\203\327\337\n!\n\324 !#\210\202\205\343\340\341\f!\"\211\262\203\3428\211\203\364\343!\210\210\344\341\f!\"\210\203 \211A@!\210\202\211@!\210\345\n!\262\207" [debug-on-error plist-member :method :id :error :params :result :jsonrpc (:method :id :error :params :result :jsonrpc :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:method :id :error :params :result :jsonrpc)" jsonrpc--log-event server \(setf\ jsonrpc-last-error\) ert-running-test (debug error) (jsonrpc-error) jsonrpc--request-dispatcher intern :code alist-get jsonrpc-error-code -32603 :message jsonrpc-error-message "Internal error" (:error (:code -32603 :message "Internal error")) apply jsonrpc--reply jsonrpc--notification-dispatcher gethash jsonrpc--request-continuations 2 cancel-timer remhash jsonrpc--call-deferred] 18 (#$ . 9723)]) #@452 Error out with FORMAT and ARGS. If invoked inside a dispatcher function, this function is suitable for replying to the remote endpoint with an error message. ARGS can be of the form (FORMAT-STRING . MOREARGS) for replying with a -32603 error code and a message formed by formatting FORMAT-STRING with MOREARGS. Alternatively ARGS can be plist representing a JSONRPC error object, using the keywords `:code', `:message' and `:data'. (fn &rest ARGS) (defalias 'jsonrpc-error #[128 "\211@;\203\300\301@A#\302\303\304\305B\306BE\"\207\211\307\310\"A@\307\311\"A@\307\312\"A@\211\203W\211@\313>\203@\211AA\262\202-\314>A@\203N\315\262\202-\316\317@\"\210\202-\210\302\303\320\321!\304B\306B\322BF\"\207" [apply format-message signal jsonrpc-error jsonrpc-error-code 32603 jsonrpc-error-message plist-member :code :message :data (:code :message :data :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:code :message :data)" format "[jsonrpc] error " jsonrpc-error-data] 12 (#$ . 11238)]) #@1007 Make a request to CONNECTION, expecting a reply, return immediately. The JSONRPC request is formed by METHOD, a symbol, and PARAMS a JSON object. The caller can expect SUCCESS-FN or ERROR-FN to be called with a JSONRPC `:result' or `:error' object, respectively. If this doesn't happen after TIMEOUT seconds (defaults to `jrpc-default-request-timeout'), the caller can expect TIMEOUT-FN to be called with no arguments. The default values of SUCCESS-FN, ERROR-FN and TIMEOUT-FN simply log the events into `jsonrpc-events-buffer'. If DEFERRED is non-nil, maybe defer the request to a future time when the server is thought to be ready according to `jsonrpc-connection-ready-p' (which see). The request might never be sent at all, in case it is overridden in the meantime by a new request with identical DEFERRED and for the same buffer. However, in that situation, the original timeout is kept. Returns nil. (fn CONNECTION METHOD PARAMS &rest ARGS &key SUCCESS-FN ERROR-FN TIMEOUT-FN TIMEOUT DEFERRED) (defalias 'jsonrpc-async-request #[899 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\300\305\"A@\211\203J\211@\306>\2032\211AA\262\202\307>A@\203A\310\262\202\311\312@\"\210\202\210\313\314\n\n\n\n%\210\310\207" [plist-member :success-fn :error-fn :timeout-fn :timeout :deferred (:success-fn :error-fn :timeout-fn :timeout :deferred :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:success-fn :error-fn :timeout-fn :timeout :deferred)" apply jsonrpc--async-request-1] 15 (#$ . 12287)]) #@836 Make a request to CONNECTION, wait for a reply. Like `jsonrpc-async-request' for CONNECTION, METHOD and PARAMS, but synchronous. Except in the case of a non-nil CANCEL-ON-INPUT (explained below), this function doesn't exit until anything interesting happens (success reply, error reply, or timeout). Furthermore, it only exits locally (returning the JSONRPC result object) if the request is successful, otherwise it exits non-locally with an error of type `jsonrpc-error'. DEFERRED and TIMEOUT as in `jsonrpc-async-request', which see. If CANCEL-ON-INPUT is non-nil and the user inputs something while the function is waiting, then it exits immediately, returning CANCEL-ON-INPUT-RETVAL. Any future replies (normal or error) are ignored. (fn CONNECTION METHOD PARAMS &key DEFERRED TIMEOUT CANCEL-ON-INPUT CANCEL-ON-INPUT-RETVAL) (defalias 'jsonrpc-request #[899 "\301\302\"A@\301\303\"A@\301\304\"A@\301\305\"A@\211\203D\211@\306>\203,\211AA\262\202\307>A@\203;\310\262\202\311\312@\"\210\202\210\313\314!\310C\310C\315\316\317\320\321\f#\322\"\323$\2162\331\324\325   \326\315\327\330\320\321 \"\331\"\332\333%\334\315\327\335\320\321\"\336\"\337\340%\341\315\316\342\320\321\"\343\"\344$\345\205\243\302D\205\254\303D\"& \240\210\203\320\315\316\346\320\321!\347\"\350$\216\351\352\353!\204\303*\354D\202\330\355\310\353\"\210\202\3200)\211@\311=\203\357\356\357\360\361\242@\"AB\"\210\211A@\266\204\207" [inhibit-quit plist-member :deferred :timeout :cancel-on-input :cancel-on-input-retval (:deferred :timeout :cancel-on-input :cancel-on-input-retval . #1=(:allow-other-keys)) :allow-other-keys nil error "Keyword argument %s not one of (:deferred :timeout :cancel-on-input :cancel-on-input-retval)" cl-gensym "jsonrpc-request-catch-tag" make-byte-code 0 "\302\242@\302\242A\211@A\303\304\300!\"\210\303\301pD\305\300!\"\210\205#\306!\266\202\207" vconcat vector [remhash jsonrpc--request-continuations jsonrpc--deferred-actions cancel-timer] 10 apply jsonrpc--async-request-1 :success-fn 257 "\301\242?\205\f\302\300\303D\"\207" [throw done] 5 "\n\n(fn RESULT)" :error-fn "\302\303\304\305\306\307\300\301\"\310\"\311\312%\"\207" [apply make-byte-code 128 "\302\303\"A@\302\304\"A@\302\305\"A@\211\203=\211@\306>\203&\211AA\262\202\307>A@\2034\310\262\202\311\312@\"\210\202\210\301\242?\205U\313\300\311\314B\315B\316BF\"\207" vconcat vector [plist-member :code :message :data (:code :message :data . #1#) :allow-other-keys nil error "Keyword argument %s not one of (:code :message :data)" throw jsonrpc-error-code jsonrpc-error-message jsonrpc-error-data] 11 "\n\n(fn &key CODE MESSAGE DATA)"] 9 "\n\n(fn JSONRPC-LAMBDA-ELEM0)" :timeout-fn "\301\242?\205\n\302\300\303\"\207" [throw (error (jsonrpc-error-message . "Timed out"))] 3 append "\300\301\240\207" [t] 2 t sit-for 30 cancelled accept-process-output signal jsonrpc-error format "request id=%s failed:"] 29 (#$ . 13846)]) #@86 Notify CONNECTION of something, don't expect a reply. (fn CONNECTION METHOD PARAMS) (defalias 'jsonrpc-notify #[771 "\300\301\302%\207" [jsonrpc-connection-send :method :params] 9 (#$ . 16843)]) (byte-code "\300\301\302\303#\210\304\211\203(\211@\301N\203!\302N\204!\305\302\301N#\210A\266\202\202\210\306\301\302\307#\207" [defvaralias jrpc-default-request-timeout jsonrpc-default-request-timeout nil (saved-value saved-variable-comment) put make-obsolete-variable "28.1"] 7) #@54 Time in seconds before timing out a JSONRPC request. (defconst jsonrpc-default-request-timeout 10 (#$ . 17340)) (byte-code "\300\301\302\303!\"\210\300\304\305\303!\"\210\300\306\304\"\210\307\306\310\311#\210\312\303\313\304#\314\303\315\316\317$\210\320\321\322\323\322\324%\210\320\325\322\326\322\327%\210\320\330\322\331\322\332%\210\320\333\322\334\322\335%\210\320\336\322\337\322\340%\210\320\341\322\342\322\343%\207" [defalias jsonrpc-process-connection-p eieio-make-class-predicate jsonrpc-process-connection jsonrpc-process-connection--eieio-childp eieio-make-child-predicate jsonrpc-process-connection-child-p make-obsolete "use (cl-typep ... \\='jsonrpc-process-connection) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal (jsonrpc-connection) ((-process :initarg :process :accessor jsonrpc--process :documentation "Process object wrapped by the this connection.") (-expected-bytes :accessor jsonrpc--expected-bytes :documentation "How many bytes declared by server.") (-on-shutdown :accessor jsonrpc--on-shutdown :initform #'ignore :initarg :on-shutdown :documentation "Function run when the process dies.")) (:documentation "A JSONRPC connection over an Emacs process.\nThe following initargs are accepted:\n\n:PROCESS (mandatory), a live running Emacs process object or a\nfunction of no arguments producing one such object. The process\nrepresents either a pipe connection to locally running process or\na stream connection to a network host. The remote endpoint is\nexpected to understand JSONRPC messages with basic HTTP-style\nenveloping headers such as \"Content-Length:\".\n\n:ON-SHUTDOWN (optional), a function of one argument, the\nconnection object, called when the process dies .") cl-generic-define-method jsonrpc--on-shutdown nil ((this jsonrpc-process-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -on-shutdown eieio-oref] 4 "Retrieve the slot `-on-shutdown' from an object of class `jsonrpc-process-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--on-shutdown\) (value (this jsonrpc-process-connection)) #[514 "\300\301#\207" [eieio-oset -on-shutdown] 6 "\n\n(fn VALUE THIS)"] jsonrpc--expected-bytes ((this jsonrpc-process-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -expected-bytes eieio-oref] 4 "Retrieve the slot `-expected-bytes' from an object of class `jsonrpc-process-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--expected-bytes\) (value (this jsonrpc-process-connection)) #[514 "\300\301#\207" [eieio-oset -expected-bytes] 6 "\n\n(fn VALUE THIS)"] jsonrpc--process ((this jsonrpc-process-connection)) #[257 "\300\301\"\205 \302\301\"\207" [slot-boundp -process eieio-oref] 4 "Retrieve the slot `-process' from an object of class `jsonrpc-process-connection'.\n\n(fn THIS)"] \(setf\ jsonrpc--process\) (value (this jsonrpc-process-connection)) #[514 "\300\301#\207" [eieio-oset -process] 6 "\n\n(fn VALUE THIS)"]] 7) #@83 Create a new object of class type `jsonrpc-process-connection'. (fn &rest SLOTS) (defalias 'jsonrpc-process-connection #[128 "\300\301\302#\207" [apply make-instance jsonrpc-process-connection] 5 (#$ . 20283)]) (byte-code "\300\301\302\303#\300\207" [function-put jsonrpc-process-connection compiler-macro jsonrpc-process-connection--anon-cmacro] 4) #@26 (fn WHOLE &rest SLOTS) (defalias 'jsonrpc-process-connection--anon-cmacro #[385 "\211@;\204\207\300\301\302@@#@\303@DABB\"\207" [macroexp--warn-and-return format "Obsolete name arg %S to constructor %S" identity] 7 (#$ . 20641)]) (byte-code "\300\301\302\303\304\305%\210\300\306\302\307\302\310%\207" [cl-generic-define-method initialize-instance nil ((conn jsonrpc-process-connection) slots) t #[771 " \210\211\301\302\"A@\301\303\"A@pr\304\305\306\"!q\210\307\310\311 P\312 \210\313 \210\314\315\316\317\320\321\322!\323\"\324\325%\326\307$\210\327!\203Jrq\210 )\202K\262\3301X\331!0\202\\\210\202]\210\332!\210\333\334p#\210\335\307!\210)\266)\210\336\"\266\337\304\305\340\"!\"\210\341\342\"\210\343\344\"\210r\345!q\210\313 \210\346!e\326\223\210\307\312 \210\335\307!\210*\333\347#\207" [inhibit-read-only plist-member :process :name get-buffer-create format "*%s stderr*" t " " buffer-name erase-buffer buffer-disable-undo add-hook after-change-functions make-byte-code 771 "\302b\210\302y\210n\203\303\304!\305\304!{\262r\306\300!q\210db\210\307\310\311\"c\210*m\203\302\207" vconcat vector [inhibit-read-only nil line-beginning-position 0 line-end-position jsonrpc-events-buffer t format "[stderr] %s\n"] 7 "\n\n(fn BEG END PRE-CHANGE-LEN)" nil functionp (error) kill-buffer rename-buffer process-put jsonrpc-stderr read-only-mode \(setf\ jsonrpc--process\) set-process-buffer " *%s output*" set-process-filter jsonrpc--process-filter set-process-sentinel jsonrpc--process-sentinel process-buffer process-mark jsonrpc-connection] 17 "\n\n(fn CL--CNM CONN SLOTS)"] jsonrpc-connection-send ((connection jsonrpc-process-connection) &rest args &key _id method _params _result _error _partial) #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\300\305\"A@\300\306\"A@\211\203R\211@\307>\203:\211AA\262\202'\310>A@\203I\311\262\202'\312\313@\"\210\202'\210\203}\314\302\315!\203l\316!\317\311O\202{\205{9\205{\316!#\210\320\321BB\322!\323\324\325\326!\"BC\327\330\f!\311\211\331:\203\271@\262\211A\262\242\262\211\332\333RP\262A\262\202\230\324\334\n#\266\204\"\210\335 \336#\266\203\207" [plist-member :id :method :params :result :error :partial (:id :method :params :result :error :partial :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:id :method :params :result :error :partial)" plist-put keywordp symbol-name 1 :jsonrpc "2.0" jsonrpc--json-encode "Content-Length" format "%d" string-bytes process-send-string jsonrpc--process "" ": " " \n" "%s \n%s" jsonrpc--log-event client] 22 "Send MESSAGE, a JSON object, to CONNECTION.\n\n(fn CONNECTION &rest ARGS &key ID METHOD PARAMS RESULT ERROR PARTIAL)"]] 6) #@66 Return the `process-type' of JSONRPC connection CONN. (fn CONN) (defalias 'jsonrpc-process-type #[257 "\300\301!!\207" [process-type jsonrpc--process] 4 (#$ . 23416)]) (byte-code "\300\301\302\303\302\304%\210\300\305\302\306\302\307%\207" [cl-generic-define-method jsonrpc-running-p nil ((conn jsonrpc-process-connection)) #[257 "\300\301!!\207" [process-live-p jsonrpc--process] 4 "Return non-nil if JSONRPC connection CONN is running.\n\n(fn CONN)"] jsonrpc-shutdown ((conn jsonrpc-process-connection) &optional cleanup) #[513 "\300\301\302\303\304\"\305\"\306$\216\307!\301\310\311\"\2045\211\301U\204%\312\313\"\210\314!\210\315\316\317\"\210\211T\262\202\316\266\202)\207" [make-byte-code 0 "\301\205\302\303\304\300!!!\210\302\305\300!!\207" vconcat vector [kill-buffer process-buffer jsonrpc--process jsonrpc-stderr-buffer] 4 jsonrpc--process process-get jsonrpc-sentinel-cleanup-started jsonrpc--warn "Sentinel for %s still hasn't run, deleting it!" delete-process accept-process-output nil 0.1] 9 "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers.\n\n(fn CONN &optional CLEANUP)"]] 6) #@54 Get CONN's standard error buffer, if any. (fn CONN) (defalias 'jsonrpc-stderr-buffer #[257 "\300\301!\302\"\207" [process-get jsonrpc--process jsonrpc-stderr] 4 (#$ . 24584)]) (byte-code "\300\301\302\"\210\303\304\305\306!\203\307\202\310\311!\210\312\313#\210\303\314\305\315!\203%\316\202*\310\311!\210\317\320#\207" [define-error jsonrpc-error "jsonrpc-error" defalias jsonrpc--json-read fboundp json-parse-buffer #[0 "\300\301\302\303\304\305\306&\207" [json-parse-buffer :object-type plist :null-object nil :false-object :json-false] 7] require json #[0 "\301\302 )\207" [json-object-type plist json-read] 1] "Read JSON object in buffer, move point to end of buffer." jsonrpc--json-encode json-serialize #[257 "\300\301\302\303\304%\207" [json-serialize :false-object :json-false :null-object nil] 7 "\n\n(fn OBJECT)"] #[257 "\302\303\304!*\207" [json-null json-false :json-false nil json-encode] 3 "\n\n(fn OBJECT)"] "Encode OBJECT into a JSON string."] 4) #@141 Reply to CONNECTION's request ID with RESULT or ERROR. (fn CONNECTION ID &key (RESULT nil RESULT-SUPPLIED-P) (ERROR nil ERROR-SUPPLIED-P)) (defalias 'jsonrpc--reply #[642 "\300\301\"\211\205\211A@\302\262\300\303\"\211\205\211A@\302\262\211\203H\211@\304>\2030\211AA\262\202\305>A@\203?\306\262\202\307\310@\"\210\202\210\311\312\313 \314 \205Z\301 D\205c\303D\"BB#\207" [plist-member :result t :error (:result :error :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:result :error)" apply jsonrpc-connection-send :id append] 16 (#$ . 25569)]) #@86 Call CONNECTION's deferred actions, who may again defer themselves. (fn CONNECTION) (defalias 'jsonrpc--call-deferred #[257 "\300!\301C\302\303\304\305\306\307!\310\"\311\312%\"\210\211\242\237\266\202\211\2053\313\314\315\316\317\320\"\"D\"\210\321\322\315\323\"\"\207" [jsonrpc--deferred-actions nil maphash make-byte-code 514 "\300\300\242B\240\207" vconcat vector [] 5 "\n\n(fn --CL-VAR-- V)" jsonrpc--debug :maybe-run-deferred mapcar apply-partially nth 2 mapc funcall car] 10 (#$ . 26185)]) #@54 Called when PROC undergoes CHANGE. (fn PROC CHANGE) (defalias 'jsonrpc--process-sentinel #[514 "\301\302\"\303\304\305\306F\"\210\307!?\205Dr\310!q\210\311\312c\210*\313\314\315!\"\210\316\317\311#\210\320\321\322\323\324\"\325\"\326$\216\313\327\315!\")\207" [inhibit-read-only process-get jsonrpc-connection jsonrpc--debug :message "Connection state changed" :change process-live-p jsonrpc-events-buffer t "\n----------b---y---e---b---y---e----------\n" maphash #[514 "\211@A\211@A\211@A\205\300!\266\203\207" [cancel-timer] 13 "\n\n(fn ID TRIPLET)"] jsonrpc--request-continuations process-put jsonrpc-sentinel-cleanup-started make-byte-code 0 "\302\303\304\300!\"\210\305\300!\210\306\301!\301!\207" vconcat vector [jsonrpc--message "Server exited with status %s" process-exit-status delete-process jsonrpc--on-shutdown] 4 #[514 "\211@A\211@A\211@A\300!\266\203\207" [(:code -1 :message "Server died")] 13 "\n\n(fn ID TRIPLET)"]] 10 (#$ . 26698)]) #@69 Called when new data STRING has arrived for PROC. (fn PROC STRING) (defalias 'jsonrpc--process-filter #[514 "\301\302!!\205\324r\302!q\210\303\304\305\"\306!C\212\307!b\210c\210\307!`\310\223\210)\311\312\313\314\315\"\316\"\317$\216\310\211?\205\316\242\204`\320\321`\322\\\303#\205S\323\324\325!!\240\210\242\2049\326\262\2029\327\307!!\327`!Z\211\242Y\203\307\330\327`!\242\\!\311\312\331\314\315\"\332\"\333$\216\214`}\210\3341\227\335 0\202\242\336\337A\340 #\210\310\262\211\203\301\341\342!r\211q\210\311\312\343\314\315!\344\"\333$\216\345\"\210*\210\210*\210\202\312\346\262\210\2029\262*\266\202)\207" [inhibit-read-only buffer-live-p process-buffer t process-get jsonrpc-connection jsonrpc--expected-bytes process-mark nil make-byte-code 0 "\300\302\301\242\"\207" vconcat vector [\(setf\ jsonrpc--expected-bytes\)] 4 search-forward-regexp "\\(?:.*: .* \n\\)*Content-Length: *\\([[:digit:]]+\\) \n\\(?:.*: .* \n\\)* \n" 100 string-to-number match-string 1 :waiting-for-new-message position-bytes byte-to-position "\301b\210e`|\210\300\302\240\207" [nil] 2 (debug error) jsonrpc--json-read jsonrpc--warn "Invalid JSON: %s %s" buffer-string generate-new-buffer " *temp*" "\301\300!\205 \302\300!\207" [buffer-name kill-buffer] jsonrpc-connection-receive :waiting-for-more-bytes-in-this-message] 15 (#$ . 27690)]) #@332 Does actual work for `jsonrpc-async-request'. Return a list (ID TIMER). ID is the new request's ID, or nil if the request was deferred. TIMER is a timer object set (or nil, if TIMEOUT is nil). (fn CONNECTION METHOD PARAMS &rest ARGS &key SUCCESS-FN ERROR-FN TIMEOUT-FN (TIMEOUT jsonrpc-default-request-timeout) (DEFERRED nil)) (defalias 'jsonrpc--async-request-1 #[899 "\301\302\"A@\301\303\"A@\301\304\"A@\301\305\"\206\306DA@\301\307\"A@\211\203P\211@\310>\2038\211AA\262\202%\311>A@\203G\306\262\202%\312\313@\"\210\202%\210\3142Np`\205d\315D\316 !\"\211A\211@A\211@A\206\317\320!T\"\262\321\322\323\324\325\f&\326\"\327$\f\203\330\"\203\267\331  D\316!\"\210\202\204\313\332\333\334\335\257\"\210\336  D\321\322\337\324\325&\340\"\341$\206\361 \211\262E\316!#\210\342\314D\"\210\343\334\344\335&\210\336\206$\321\345\346\324\325 \"\347\"\350\351%\2068\321\345\346\324\325\n\"\352\"\350\353% \211\262E\354!#\210D\266\202\266\202\266\2100\207" [jsonrpc-default-request-timeout plist-member :success-fn :error-fn :timeout-fn :timeout nil :deferred (:success-fn :error-fn :timeout-fn :timeout :deferred :allow-other-keys) :allow-other-keys error "Keyword argument %s not one of (:success-fn :error-fn :timeout-fn :timeout :deferred)" --cl-block-jsonrpc--async-request-1-- gethash jsonrpc--deferred-actions \(setf\ jsonrpc--next-request-id\) jsonrpc--next-request-id make-byte-code 0 "\304\205\310\304\311\312\313\314\315\316\300\301\302\303\305\306\307&\317\"\320$#\207" vconcat vector [run-with-timer nil make-byte-code 0 "\307\306\310\300!\"\210\307\304\305D\311\300!\"\210\303\203\303 \207\312\300\313\301\314\306\315\302\257\"\207" vconcat vector [remhash jsonrpc--request-continuations jsonrpc--deferred-actions jsonrpc--debug :timed-out :id :params] 8] 15 jsonrpc-connection-ready-p remhash jsonrpc--debug :deferring :id :params puthash "\306\304!\205r\304q\210\212\305b\210\307\310\300\301\302\303%*\207" [buffer-live-p apply jsonrpc-async-request] 6 throw jsonrpc-connection-send :method 257 "\302\303\304\305\306\307\300\301\"\310\"\311\312%\"\207" [apply make-byte-code 128 "\302\300\303\304\305\301F\"\207" vconcat vector [jsonrpc--debug :message "success ignored" :id] 7 "\n\n(fn &rest IGNORED)"] 9 "\n\n(fn JSONRPC-LAMBDA-ELEM1)" [apply make-byte-code 128 "\302\303\"A@\302\304\"A@\305\300\304\306\307\"\310\301\311\257\"\207" vconcat vector [plist-member :code :message jsonrpc--debug format "error ignored, status set (%s)" :id :error] 11 "\n\n(fn &key CODE MESSAGE &allow-other-keys)"] "\n\n(fn JSONRPC-LAMBDA-ELEM2)" jsonrpc--request-continuations] 34 (#$ . 29067)]) #@60 Message out with FORMAT with ARGS. (fn FORMAT &rest ARGS) (defalias 'jsonrpc--message #[385 "\300\301\302\303#\"\207" [message "[jsonrpc] %s" apply format] 8 (#$ . 31806)]) #@79 Debug message for SERVER with FORMAT and ARGS. (fn SERVER FORMAT &rest ARGS) (defalias 'jsonrpc--debug #[642 "\300;\203\301\302\"D\202\"\207" [jsonrpc--log-event :message format] 9 (#$ . 31988)]) #@63 Warning message with FORMAT and ARGS. (fn FORMAT &rest ARGS) (defalias 'jsonrpc--warn #[385 "\301\302\303P#\210\304\305\306\301\307#\310#)\207" [warning-minimum-level apply jsonrpc--message "(warning) " :error display-warning jsonrpc format :warning] 8 (#$ . 32200)]) #@206 Log a JSONRPC-related event. CONNECTION is the current connection. MESSAGE is a JSON-like plist. TYPE is a symbol saying if this is a client or server originated. (fn CONNECTION MESSAGE &optional TYPE) (defalias 'jsonrpc--log-event #[770 "\301!\211\203\211\211\302V\262\205\270r\303!q\210\304\305\"A@\304\306\"A@\304\307\"A@\310\2037\2037\311\202H\203?\312\202H\203G\313\202H\314\315\316\206P\317\"\205Z\315\320\"Pdb\210\315\321\203n\315\322\"\202o\323\203x\324\202y\323\325 \326!&\203\214\327\330\331#\262\332!\262\203\264\212eb\210\333 V\203\263`\334y\210\335\334!\210\336y\210`|\210\202\232))\266\206)\207" [inhibit-read-only jsonrpc--events-buffer-scrollback-size 0 jsonrpc-events-buffer plist-member :method :id :error t request notification reply message format "%s" internal "-%s" "[%s]%s%s %s:\n%s" " (id:%s)" "" " ERROR" current-time-string pp-to-string propertize face error insert-before-markers buffer-size 1 forward-sexp 2] 18 (#$ . 32481)]) (provide 'jsonrpc)