manateelazycat / lsp-bridge

A blazingly fast LSP client for Emacs
GNU General Public License v3.0
1.46k stars 214 forks source link

wrong-type-argument lsp-bridge-epc-manager nil #833

Closed anbanpillay closed 10 months ago

anbanpillay commented 10 months ago

I am on emacs 29.1 on macos running emacs-plus.

Really like lsp-bridge. When I try to login into copilot I get this error. lsp-bridge is enable in the buffer when I issue the command lsp-bridge-copilot-login.

Is there a configuration I am missing?

Debugger entered--Lisp error: (wrong-type-argument lsp-bridge-epc-manager nil)
  signal(wrong-type-argument (lsp-bridge-epc-manager nil))
  (or (progn (and (memq (type-of mngr) cl-struct-lsp-bridge-epc-manager-tags) t)) (signal 'wrong-type-argument (list 'lsp-bridge-epc-manager mngr)))
  (progn (or (progn (and (memq (type-of mngr) cl-struct-lsp-bridge-epc-manager-tags) t)) (signal 'wrong-type-argument (list 'lsp-bridge-epc-manager mngr))) (aref mngr 7))
  (let ((uid (lsp-bridge-epc-uid)) (sessions (progn (or (progn (and (memq ... cl-struct-lsp-bridge-epc-manager-tags) t)) (signal 'wrong-type-argument (list 'lsp-bridge-epc-manager mngr))) (aref mngr 7))) (d (lsp-bridge-deferred-new))) (setq sessions (cons (cons uid d) sessions)) (progn (or (progn (and (memq (type-of mngr) cl-struct-lsp-bridge-epc-manager-tags) t)) (signal 'wrong-type-argument (list 'lsp-bridge-epc-manager mngr))) (let* ((v mngr)) (aset v 7 sessions))) (lsp-bridge-epc-manager-send mngr 'call uid method-name args) d)
  lsp-bridge-epc-call-deferred(nil copilot_login nil)
  (setq it (lsp-bridge-epc-call-deferred lsp-bridge-epc-process (read method) args))
  (let (it) (setq it (lsp-bridge-epc-call-deferred lsp-bridge-epc-process (read method) args)) it)
  lsp-bridge-call-async("copilot_login")
  lsp-bridge-copilot-login()
  funcall-interactively(lsp-bridge-copilot-login)
  command-execute(lsp-bridge-copilot-login record)
  #<subr execute-extended-command>(nil "lsp-bridge-copilot-login" "lsp")
  ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "lsp-bridge-copilot-login" "lsp")
  apply(ad-Advice-execute-extended-command #<subr execute-extended-command> (nil "lsp-bridge-copilot-login" "lsp"))
  execute-extended-command(nil "lsp-bridge-copilot-login" "lsp")
  funcall-interactively(execute-extended-command nil "lsp-bridge-copilot-login" "lsp")
  command-execute(execute-extended-command)
anbanpillay commented 10 months ago

Apologies - I just realised it was a path problem with more than one python installation. The error goes away when lsp-bridge can find the python dependencies.

yanboyang713 commented 10 months ago

Hello @anbanpillay,

I had the same issue. How did you figure it out?

Boyang

anbanpillay commented 10 months ago

On macOS I have python installed via home brew and conda. When I installed lsp-bridge requirements it installed in homebrew python. But when you open eMacs it uses the python in conda. So I installed the requirements in both base environments. So check which python you running.

yanboyang713 commented 10 months ago

ok, Thanks @anbanpillay

  1. check where is python3, which I installed base packages.
    yanboyang713@Meta-Scientific-Linux ~ % whereis python3
    python3: /usr/bin/python3 /opt/mambaforge/bin/python3 /usr/share/man/man1/python3.1.gz
  2. change python command line
    (setq lsp-bridge-python-command "/usr/bin/python3")

problem fixed

anbanpillay commented 10 months ago

Nice. Clean solution @yanboyang713