Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest commit (f8283e4) causes runtime exception: (wrong-type-argument package-desc nil) #261

Closed
rnadler opened this issue Feb 15, 2024 · 3 comments · Fixed by #264
Closed

Comments

@rnadler
Copy link

rnadler commented Feb 15, 2024

Emacs 29.2
node v19.4.0
Pin to commit 581cadd to resolve.

Debugger entered--Lisp error: (wrong-type-argument package-desc nil)
  signal(wrong-type-argument (package-desc nil))
  (or (progn (and (memq (type-of desc) cl-struct-package-desc-tags) t)) (signal 'wrong-type-argument (list 'package-desc desc)))
  (progn (or (progn (and (memq (type-of desc) cl-struct-package-desc-tags) t)) (signal 'wrong-type-argument (list 'package-desc desc))) (aref desc 2))
  (let* ((desc (package-get-descriptor 'jsonrpc)) (vlist (progn (or (progn (and (memq ... cl-struct-package-desc-tags) t)) (signal 'wrong-type-argument (list 'package-desc desc))) (aref desc 2))) (version (package-version-join vlist))) version)
  copilot--jsonrpc-version()
  (version< (copilot--jsonrpc-version) "1.0.23")
  (let ((node-version (string-to-number (s-chop-prefix "v" (s-trim (let (...) (unwind-protect ... ...)))))) (old-jsonrpc (version< (copilot--jsonrpc-version) "1.0.23"))) (cond ((< node-version 18) (user-error "Node 18+ is required but found %s" node-version)) (t (setq copilot--connection (make-instance 'jsonrpc-process-connection :name "copilot" (if old-jsonrpc :events-buffer-scrollback-size :events-buffer-config) (if old-jsonrpc copilot-log-max (list ':size copilot-log-max)) :notification-dispatcher #'copilot--handle-notification :process (make-process :name "copilot agent" :command (list copilot-node-executable (concat copilot--base-dir "/dist/agent.js")) :coding 'utf-8-emacs-unix :connection-type 'pipe :stderr (get-buffer-create "*copilot stderr*") :noquery t))) (message "Copilot agent started.") (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (jsonrpc-request copilot--connection 'initialize '(:capabilities (:workspace ...)))) (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (let ((buf (current-buffer))) (jsonrpc-async-request copilot--connection 'setEditorInfo (cons ':editorInfo (cons ... ...)) :success-fn #'(lambda ... ...)))))))
  (if (not (locate-file copilot-node-executable exec-path)) (user-error "Could not find node executable") (let ((node-version (string-to-number (s-chop-prefix "v" (s-trim (let ... ...))))) (old-jsonrpc (version< (copilot--jsonrpc-version) "1.0.23"))) (cond ((< node-version 18) (user-error "Node 18+ is required but found %s" node-version)) (t (setq copilot--connection (make-instance 'jsonrpc-process-connection :name "copilot" (if old-jsonrpc :events-buffer-scrollback-size :events-buffer-config) (if old-jsonrpc copilot-log-max (list ... copilot-log-max)) :notification-dispatcher #'copilot--handle-notification :process (make-process :name "copilot agent" :command (list copilot-node-executable ...) :coding 'utf-8-emacs-unix :connection-type 'pipe :stderr (get-buffer-create "*copilot stderr*") :noquery t))) (message "Copilot agent started.") (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (jsonrpc-request copilot--connection 'initialize '(:capabilities ...))) (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (let ((buf ...)) (jsonrpc-async-request copilot--connection 'setEditorInfo (cons ... ...) :success-fn #'...)))))))
  copilot--start-agent()
  (if (copilot--connection-alivep) nil (copilot--start-agent))
  (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (jsonrpc-notify copilot--connection 'textDocument/didClose (list :textDocument (list :uri (copilot--get-uri)))))
  (progn (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (jsonrpc-notify copilot--connection 'textDocument/didClose (list :textDocument (list :uri (copilot--get-uri))))) (setq copilot--opened-buffers (delete (current-buffer) copilot--opened-buffers)))
  (if (-contains-p copilot--opened-buffers (current-buffer)) (progn (progn (if (copilot--connection-alivep) nil (copilot--start-agent)) (jsonrpc-notify copilot--connection 'textDocument/didClose (list :textDocument (list :uri (copilot--get-uri))))) (setq copilot--opened-buffers (delete (current-buffer) copilot--opened-buffers))))
  copilot--on-doc-close()
  kill-buffer("packages.el")
  funcall-interactively(kill-buffer "packages.el")
  command-execute(kill-buffer)

@jcs090218
Copy link
Member

Sorry about this. I've opened the fix in #260.

@rnadler
Copy link
Author

rnadler commented Feb 15, 2024

No more errors, but I noticed that after copilot starts a file buffer containing jsonrpc/jsonrpc.el is opened. I don't believe this was happening before. I can close it manually, but this seems undesirable.

@jcs090218
Copy link
Member

Thank you for the report! I've updated the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants