emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.04k stars 139 forks source link

lsp-ui-doc-hide-frame-on-window-change wrong-type-argument window-live-p nil #477

Closed zoechi closed 4 years ago

zoechi commented 4 years ago

When I start debugging (JS with Chrome) and a breakpoint is hit I get this error output:

Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
  #<subr select-window>(nil norecord)
  lsp-ui-doc-hide-frame-on-window-change(#<subr select-window> nil norecord)
  apply(lsp-ui-doc-hide-frame-on-window-change #<subr select-window> (nil norecord))
  select-window(nil norecord)
  (progn (select-window (car save-selected-window--state) 'norecord) (set-window-fringes (selected-window) 8))
  (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (set-window-fringes (selected-window) 8)) (internal--after-with-selected-window save-selected-window--state))
  (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (set-window-fringes (selected-window) 8)) (internal--after-with-selected-window save-selected-window--state)))
  (let ((save-selected-window--state (internal--before-with-selected-window (treemacs-get-local-window)))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (set-window-fringes (selected-window) 8)) (internal--after-with-selected-window save-selected-window--state))))
  (closure (t) nil (let ((save-selected-window--state (internal--before-with-selected-window (treemacs-get-local-window)))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (set-window-fringes (selected-window) 8)) (internal--after-with-selected-window save-selected-window--state)))))()
  run-hooks(change-major-mode-after-body-hook special-mode-hook treemacs-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook special-mode-hook treemacs-mode-hook))
  run-mode-hooks(treemacs-mode-hook)
  #f(compiled-function () (interactive nil) #<bytecode 0x6cb7cf43b4e55e1>)()
  apply(#f(compiled-function () (interactive nil) #<bytecode 0x6cb7cf43b4e55e1>) nil)
  treemacs--mode-check-advice(#f(compiled-function () (interactive nil) #<bytecode 0x6cb7cf43b4e55e1>))
  apply(treemacs--mode-check-advice #f(compiled-function () (interactive nil) #<bytecode 0x6cb7cf43b4e55e1>) nil)
  treemacs-mode()
  treemacs-initialize()
  lsp-treemacs-initialize()
  lsp-treemacs-render(((:label #("ATMSE Chrome::Run" 0 17 ...) :key "ATMSE Chrome::Run" :session #s(dap--debug-session :name "ATMSE Chrome::Run" :last-id 5 :proc #<process ATMSE Chrome::Run> :response-handlers #<hash-table eql 0/65 0x16614494944d> :parser ... :output-buffer #<buffer *ATMSE Chrome::Run out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x166144949481> :active-frame-id nil :active-frame nil :cursor-marker nil :state terminated :breakpoints #<hash-table equal 0/65 0x1661449525c5> :thread-stack-frames #<hash-table eql 0/65 0x1661449529c5> :launch-args ... :initialize-result #<hash-table equal 6/65 0x166144aec941> :error-message nil :loaded-sources ... :program-proc nil :metadata #<hash-table eql 0/65 0x166144952d65>) :ret-action dap-ui-session-select :icon session-terminated :actions (... ... "--" ...) :children-async nil) (:label #("ATMSE Chrome::Run<1>" 0 20 ...) :key "ATMSE Chrome::Run<1>" :session #s(dap--debug-session :name "ATMSE Chrome::Run<1>" :last-id 5 :proc #<process ATMSE Chrome::Run<1>> :response-handlers #<hash-table eql 0/65 0x16614567993d> :parser ... :output-buffer #<buffer *ATMSE Chrome::Run<1> out*> :thread-id 1 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x166145679c49> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x166145679f41> :thread-stack-frames #<hash-table eql 0/65 0x16614567a171> :launch-args ... :initialize-result #<hash-table equal 6/65 0x1661456bba65> :error-message nil :loaded-sources ... :program-proc nil :metadata #<hash-table eql 0/65 0x16614567a191>) :ret-action dap-ui-session-select :icon session-started :actions (... ... ... "--" ...) :children-async #f(compiled-function (node callback) #<bytecode -0x5ffbd6ef6be7eaa>))) " Debug Sessions " nil "*dap-ui-sessions*" (["Delete All Sessions" dap-delete-all-sessions]))
  dap-ui-sessions()
  #f(compiled-function (feature-start-stop) #<bytecode -0x1a3caa3de54c55bc>)(sessions)
  mapc(#f(compiled-function (feature-start-stop) #<bytecode -0x1a3caa3de54c55bc>) (sessions locals breakpoints expressions controls tooltip))
  seq-do(#f(compiled-function (feature-start-stop) #<bytecode -0x1a3caa3de54c55bc>) (sessions locals breakpoints expressions controls tooltip))
  dap-ui--show-many-windows(#s(dap--debug-session :name "ATMSE Chrome::Run<1>" :last-id 5 :proc #<process ATMSE Chrome::Run<1>> :response-handlers #<hash-table eql 0/65 0x16614567993d> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *ATMSE Chrome::Run<1> out*> :thread-id 1 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x166145679c49> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x166145679f41> :thread-stack-frames #<hash-table eql 0/65 0x16614567a171> :launch-args (:type "chrome" :cwd "/home/user/source/AT..." :request "launch" :webRoot "/home/user/source/AT..." :url "https://localhost:5001" :name "ATMSE Chrome::Run<1>" :dap-server-path ("node" "/home/user/.vscode/extensions/msjsdiag.debugger-fo...")) :initialize-result #<hash-table equal 6/65 0x1661456bba65> :error-message nil :loaded-sources (#<hash-table equal 3/65 0x166145986fbd> #<hash-table equal 3/65 0x1661459864c5> #<hash-table equal 3/65 0x166145984b51> #<hash-table equal 3/65 0x166145983e25> #<hash-table equal 3/65 0x16614598351d> #<hash-table equal 3/65 0x1661459827f5> #<hash-table equal 3/65 0x166145981eed> #<hash-table equal 3/65 0x1661459809c5> #<hash-table equal 3/65 0x16614597effd> #<hash-table equal 3/65 0x16614597e2d5> #<hash-table equal 3/65 0x16614597d4b5> #<hash-table equal 3/65 0x16614597cc61> #<hash-table equal 3/65 0x16614597bbdd> #<hash-table equal 3/65 0x1661458fed95> #<hash-table equal 3/65 0x1661458fe1f5> #<hash-table equal 3/65 0x1661458fd765> #<hash-table equal 3/65 0x1661458fbb29> #<hash-table equal 3/65 0x1661458fb099> #<hash-table equal 3/65 0x1661458fa4f9> #<hash-table equal 3/65 0x1661458f9c99> #<hash-table equal 3/65 0x1661458f8ad5> #<hash-table equal 3/65 0x1661458f8665> #<hash-table equal 3/65 0x1661458f6639> #<hash-table equal 3/65 0x1661458f61c9> #<hash-table equal 3/65 0x1661458f4c05> #<hash-table equal 3/65 0x1661458f4b95> #<hash-table equal 3/65 0x1661458f35d1> #<hash-table equal 3/65 0x1661458f3565> #<hash-table equal 3/65 0x1661458f1955> #<hash-table equal 3/65 0x1661458f0339> #<hash-table equal 3/65 0x1661458efb29> #<hash-table equal 3/65 0x1661458eed0d> #<hash-table equal 3/65 0x1661458ee4fd> #<hash-table equal 3/65 0x1661458ec63d> #<hash-table equal 3/65 0x1661458ebe2d> #<hash-table equal 3/65 0x1661458eb23d> #<hash-table equal 3/65 0x1661458eaa2d> #<hash-table equal 3/65 0x1661458e9c09> #<hash-table equal 3/65 0x1661458e93f9> #<hash-table equal 3/65 0x1661458e75c9> #<hash-table equal 3/65 0x1661458e6db9> #<hash-table equal 3/65 0x1661458e5f9d> #<hash-table equal 3/65 0x1661458e578d> #<hash-table equal 3/65 0x1661458e4971> #<hash-table equal 3/65 0x1661458e4161> #<hash-table equal 3/65 0x1661458e21a1> #<hash-table equal 3/65 0x1661458e1991> #<hash-table equal 3/65 0x1661458ce6b5> #<hash-table equal 3/65 0x1661458cdf05> #<hash-table equal 3/65 0x1661458cd2b5> ...) :program-proc nil :metadata #<hash-table eql 0/65 0x16614567a191>))
  run-hook-with-args(dap-ui--show-many-windows #s(dap--debug-session :name "ATMSE Chrome::Run<1>" :last-id 5 :proc #<process ATMSE Chrome::Run<1>> :response-handlers #<hash-table eql 0/65 0x16614567993d> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *ATMSE Chrome::Run<1> out*> :thread-id 1 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x166145679c49> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x166145679f41> :thread-stack-frames #<hash-table eql 0/65 0x16614567a171> :launch-args (:type "chrome" :cwd "/home/user/source/AT..." :request "launch" :webRoot "/home/user/source/AT..." :url "https://localhost:5001" :name "ATMSE Chrome::Run<1>" :dap-server-path ("node" "/home/user/.vscode/extensions/msjsdiag.debugger-fo...")) :initialize-result #<hash-table equal 6/65 0x1661456bba65> :error-message nil :loaded-sources (#<hash-table equal 3/65 0x166145986fbd> #<hash-table equal 3/65 0x1661459864c5> #<hash-table equal 3/65 0x166145984b51> #<hash-table equal 3/65 0x166145983e25> #<hash-table equal 3/65 0x16614598351d> #<hash-table equal 3/65 0x1661459827f5> #<hash-table equal 3/65 0x166145981eed> #<hash-table equal 3/65 0x1661459809c5> #<hash-table equal 3/65 0x16614597effd> #<hash-table equal 3/65 0x16614597e2d5> #<hash-table equal 3/65 0x16614597d4b5> #<hash-table equal 3/65 0x16614597cc61> #<hash-table equal 3/65 0x16614597bbdd> #<hash-table equal 3/65 0x1661458fed95> #<hash-table equal 3/65 0x1661458fe1f5> #<hash-table equal 3/65 0x1661458fd765> #<hash-table equal 3/65 0x1661458fbb29> #<hash-table equal 3/65 0x1661458fb099> #<hash-table equal 3/65 0x1661458fa4f9> #<hash-table equal 3/65 0x1661458f9c99> #<hash-table equal 3/65 0x1661458f8ad5> #<hash-table equal 3/65 0x1661458f8665> #<hash-table equal 3/65 0x1661458f6639> #<hash-table equal 3/65 0x1661458f61c9> #<hash-table equal 3/65 0x1661458f4c05> #<hash-table equal 3/65 0x1661458f4b95> #<hash-table equal 3/65 0x1661458f35d1> #<hash-table equal 3/65 0x1661458f3565> #<hash-table equal 3/65 0x1661458f1955> #<hash-table equal 3/65 0x1661458f0339> #<hash-table equal 3/65 0x1661458efb29> #<hash-table equal 3/65 0x1661458eed0d> #<hash-table equal 3/65 0x1661458ee4fd> #<hash-table equal 3/65 0x1661458ec63d> #<hash-table equal 3/65 0x1661458ebe2d> #<hash-table equal 3/65 0x1661458eb23d> #<hash-table equal 3/65 0x1661458eaa2d> #<hash-table equal 3/65 0x1661458e9c09> #<hash-table equal 3/65 0x1661458e93f9> #<hash-table equal 3/65 0x1661458e75c9> #<hash-table equal 3/65 0x1661458e6db9> #<hash-table equal 3/65 0x1661458e5f9d> #<hash-table equal 3/65 0x1661458e578d> #<hash-table equal 3/65 0x1661458e4971> #<hash-table equal 3/65 0x1661458e4161> #<hash-table equal 3/65 0x1661458e21a1> #<hash-table equal 3/65 0x1661458e1991> #<hash-table equal 3/65 0x1661458ce6b5> #<hash-table equal 3/65 0x1661458cdf05> #<hash-table equal 3/65 0x1661458cd2b5> ...) :program-proc nil :metadata #<hash-table eql 0/65 0x16614567a191>))
  dap--select-thread-id(#s(dap--debug-session :name "ATMSE Chrome::Run<1>" :last-id 5 :proc #<process ATMSE Chrome::Run<1>> :response-handlers #<hash-table eql 0/65 0x16614567993d> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *ATMSE Chrome::Run<1> out*> :thread-id 1 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x166145679c49> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x166145679f41> :thread-stack-frames #<hash-table eql 0/65 0x16614567a171> :launch-args (:type "chrome" :cwd "/home/user/sourceAT..." :request "launch" :webRoot "/home/user/source/AT..." :url "https://localhost:5001" :name "ATMSE Chrome::Run<1>" :dap-server-path ("node" "/home/user/.vscode/extensions/msjsdiag.debugger-fo...")) :initialize-result #<hash-table equal 6/65 0x1661456bba65> :error-message nil :loaded-sources (#<hash-table equal 3/65 0x166145986fbd> #<hash-table equal 3/65 0x1661459864c5> #<hash-table equal 3/65 0x166145984b51> #<hash-table equal 3/65 0x166145983e25> #<hash-table equal 3/65 0x16614598351d> #<hash-table equal 3/65 0x1661459827f5> #<hash-table equal 3/65 0x166145981eed> #<hash-table equal 3/65 0x1661459809c5> #<hash-table equal 3/65 0x16614597effd> #<hash-table equal 3/65 0x16614597e2d5> #<hash-table equal 3/65 0x16614597d4b5> #<hash-table equal 3/65 0x16614597cc61> #<hash-table equal 3/65 0x16614597bbdd> #<hash-table equal 3/65 0x1661458fed95> #<hash-table equal 3/65 0x1661458fe1f5> #<hash-table equal 3/65 0x1661458fd765> #<hash-table equal 3/65 0x1661458fbb29> #<hash-table equal 3/65 0x1661458fb099> #<hash-table equal 3/65 0x1661458fa4f9> #<hash-table equal 3/65 0x1661458f9c99> #<hash-table equal 3/65 0x1661458f8ad5> #<hash-table equal 3/65 0x1661458f8665> #<hash-table equal 3/65 0x1661458f6639> #<hash-table equal 3/65 0x1661458f61c9> #<hash-table equal 3/65 0x1661458f4c05> #<hash-table equal 3/65 0x1661458f4b95> #<hash-table equal 3/65 0x1661458f35d1> #<hash-table equal 3/65 0x1661458f3565> #<hash-table equal 3/65 0x1661458f1955> #<hash-table equal 3/65 0x1661458f0339> #<hash-table equal 3/65 0x1661458efb29> #<hash-table equal 3/65 0x1661458eed0d> #<hash-table equal 3/65 0x1661458ee4fd> #<hash-table equal 3/65 0x1661458ec63d> #<hash-table equal 3/65 0x1661458ebe2d> #<hash-table equal 3/65 0x1661458eb23d> #<hash-table equal 3/65 0x1661458eaa2d> #<hash-table equal 3/65 0x1661458e9c09> #<hash-table equal 3/65 0x1661458e93f9> #<hash-table equal 3/65 0x1661458e75c9> #<hash-table equal 3/65 0x1661458e6db9> #<hash-table equal 3/65 0x1661458e5f9d> #<hash-table equal 3/65 0x1661458e578d> #<hash-table equal 3/65 0x1661458e4971> #<hash-table equal 3/65 0x1661458e4161> #<hash-table equal 3/65 0x1661458e21a1> #<hash-table equal 3/65 0x1661458e1991> #<hash-table equal 3/65 0x1661458ce6b5> #<hash-table equal 3/65 0x1661458cdf05> #<hash-table equal 3/65 0x1661458cd2b5> ...) :program-proc nil :metadata #<hash-table eql 0/65 0x16614567a191>) 1)
  dap--on-event(#s(dap--debug-session :name "ATMSE Chrome::Run<1>" :last-id 5 :proc #<process ATMSE Chrome::Run<1>> :response-handlers #<hash-table eql 0/65 0x16614567993d> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *ATMSE Chrome::Run<1> out*> :thread-id 1 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x166145679c49> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x166145679f41> :thread-stack-frames #<hash-table eql 0/65 0x16614567a171> :launch-args (:type "chrome" :cwd "/home/user/source/AT..." :request "launch" :webRoot "/home/user/source/AT..." :url "https://localhost:5001" :name "ATMSE Chrome::Run<1>" :dap-server-path ("node" "/home/user/.vscode/extensions/msjsdiag.debugger-fo...")) :initialize-result #<hash-table equal 6/65 0x1661456bba65> :error-message nil :loaded-sources (#<hash-table equal 3/65 0x166145986fbd> #<hash-table equal 3/65 0x1661459864c5> #<hash-table equal 3/65 0x166145984b51> #<hash-table equal 3/65 0x166145983e25> #<hash-table equal 3/65 0x16614598351d> #<hash-table equal 3/65 0x1661459827f5> #<hash-table equal 3/65 0x166145981eed> #<hash-table equal 3/65 0x1661459809c5> #<hash-table equal 3/65 0x16614597effd> #<hash-table equal 3/65 0x16614597e2d5> #<hash-table equal 3/65 0x16614597d4b5> #<hash-table equal 3/65 0x16614597cc61> #<hash-table equal 3/65 0x16614597bbdd> #<hash-table equal 3/65 0x1661458fed95> #<hash-table equal 3/65 0x1661458fe1f5> #<hash-table equal 3/65 0x1661458fd765> #<hash-table equal 3/65 0x1661458fbb29> #<hash-table equal 3/65 0x1661458fb099> #<hash-table equal 3/65 0x1661458fa4f9> #<hash-table equal 3/65 0x1661458f9c99> #<hash-table equal 3/65 0x1661458f8ad5> #<hash-table equal 3/65 0x1661458f8665> #<hash-table equal 3/65 0x1661458f6639> #<hash-table equal 3/65 0x1661458f61c9> #<hash-table equal 3/65 0x1661458f4c05> #<hash-table equal 3/65 0x1661458f4b95> #<hash-table equal 3/65 0x1661458f35d1> #<hash-table equal 3/65 0x1661458f3565> #<hash-table equal 3/65 0x1661458f1955> #<hash-table equal 3/65 0x1661458f0339> #<hash-table equal 3/65 0x1661458efb29> #<hash-table equal 3/65 0x1661458eed0d> #<hash-table equal 3/65 0x1661458ee4fd> #<hash-table equal 3/65 0x1661458ec63d> #<hash-table equal 3/65 0x1661458ebe2d> #<hash-table equal 3/65 0x1661458eb23d> #<hash-table equal 3/65 0x1661458eaa2d> #<hash-table equal 3/65 0x1661458e9c09> #<hash-table equal 3/65 0x1661458e93f9> #<hash-table equal 3/65 0x1661458e75c9> #<hash-table equal 3/65 0x1661458e6db9> #<hash-table equal 3/65 0x1661458e5f9d> #<hash-table equal 3/65 0x1661458e578d> #<hash-table equal 3/65 0x1661458e4971> #<hash-table equal 3/65 0x1661458e4161> #<hash-table equal 3/65 0x1661458e21a1> #<hash-table equal 3/65 0x1661458e1991> #<hash-table equal 3/65 0x1661458ce6b5> #<hash-table equal 3/65 0x1661458cdf05> #<hash-table equal 3/65 0x1661458cd2b5> ...) :program-proc nil :metadata #<hash-table eql 0/65 0x16614567a191>) #<hash-table equal 4/65 0x1661452260dd>)
  #f(compiled-function (m) #<bytecode 0x1d493786cecc24da>)("{\"seq\":470,\"type\":\"event\",\"event\":\"stopped\",\"body\"...")
  mapc(#f(compiled-function (m) #<bytecode 0x1d493786cecc24da>) ("{\"seq\":470,\"type\":\"event\",\"event\":\"stopped\",\"body\"..."))
  #f(compiled-function (_ msg) #<bytecode -0x172a3c557885ae61>)(#<process ATMSE Chrome::Run<1>> "Content-Length: 125\15\n\15\n{\"seq\":470,\"type\":\"event\",\"...")

Emacs 28.0.50 All packages just updated to latest (I haven't used this functionality before the update since a while and not at all with Chrome or JS/TS)

I have lsp-ui-doc-mode disabled

(use-package
  lsp-ui
  :bind (:map lsp-ui-mode-map
              ("<f12>" . lsp-ui-doc-glance)
              ("C-:" . 'lsp-ui-peek-find-references))
  :hook ((lsp-ui-mode . (lambda ()
                          (lsp-ui-doc-mode -1)
                          (lsp-ui-sideline-mode -1)))))
sebastiencs commented 4 years ago

Should be fixed by https://github.com/emacs-lsp/lsp-ui/commit/31542bb533faee16200411dac0600d392b0e3b7b

sebastiencs commented 4 years ago

@zoechi Please reopen if the error still occurs