jsonrpc error during copilot-login
emacs-version is 29.0.50, which has jsonrpc 1.0.15 built in. copilot-version is 0.9.6 node --version is v16.15.1
When I run copilot-login I get an error producing this backtrace:
Debugger entered--Lisp error: (jsonrpc-error "request id=3 failed:" (jsonrpc-error-code . -32602) (jsonrpc-error-message . "Invalid params: must be object") (jsonrpc-error-data))
signal(jsonrpc-error ("request id=3 failed:" (jsonrpc-error-code . -32602) (jsonrpc-error-message . "Invalid params: must be object") (jsonrpc-error-data)))
jsonrpc-request(#<jsonrpc-process-connection jsonrpc-process-connection-156badb09cac> signInInitiate 'nil)
copilot-login()
funcall-interactively(copilot-login)
call-interactively(copilot-login record nil)
command-execute(copilot-login record)
execute-extended-command(nil "copilot-login" "copilot-logi")
funcall-interactively(execute-extended-command nil "copilot-login" "copilot-logi")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
The contents of the *copilot events* buffer:
(:jsonrpc "2.0" :id 1 :result
(:capabilities
(:textDocumentSync
(:openClose t :change 2)
:workspace
(:workspaceFolders
(:supported :json-false :changeNotifications :json-false)))))
[client-request] (id:2) Tue Jul 26 13:12:29 2022:
(:jsonrpc "2.0" :id 2 :method "setEditorInfo" :params
(:editorInfo
(:name "Emacs" :version "29.0.50")
:editorPluginInfo
(:name "copilot.el" :version "0.9.6")))
[client-request] (id:3) Tue Jul 26 13:12:29 2022:
(:jsonrpc "2.0" :id 3 :method "signInInitiate" :params 'nil)
[server-reply] (id:2) Tue Jul 26 13:12:29 2022:
(:jsonrpc "2.0" :id 2 :result "OK")
[server-reply] (id:3) ERROR Tue Jul 26 13:12:29 2022:
(:jsonrpc "2.0" :id 3 :error
(:code -32602 :message "Invalid params: must be object"))
I tested with the same Emacs/Node/jsonrpc/copilot.el versions (on Mac) but failed to reproduce it.
It looks like jsonrpc problem, but should not happen on jsonrpc 1.0.15. jsonrpc should serialize ''nil to {}, but ""(empty string) in your case.
Hello,
I have the exact same problem. I tried with a machine on Ubuntu 20.04.4 and with the following versions:
- emacs 27 / node 17
- emacs 28 / node 17
- emacs 28 / node 16
Thanks for your package, and for your help :)
Fixed by #64