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 child frame flashes and disappears when position is at-point and more than 1 buffer or window is open #524

Closed douglasdavis closed 3 years ago

douglasdavis commented 3 years ago

When lsp-ui-doc-position is set to at-point and I have more than 1 buffer or window open with lsp-mode enabled: the child frame (for the doc summary) flashes and disappears instantaneously. If the variable is set to top or bottom I don't see the issue.

jcs090218 commented 3 years ago

Yes, I think I can reproduce this issue.

seagle0128 commented 3 years ago

Same issue here.

Updated:

Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 60>)
  window-text-pixel-size(#<window 60> nil nil 10000 10000 t)
  lsp-ui-doc--move-frame(#<frame  0x7fe4467c8570>)
  lsp-ui-doc--display("printf" #("printf: printf [-v var] format [arguments]\n    pri..." 0 6 (markdown-gfm-code (9 802) markdown-metadata-key (9 51 9 15 15 17 17 51 #<killed buffer>) face (markdown-metadata-key-face markdown-code-face) font-lock-multiline t) 6 8 (markdown-gfm-code (9 802) markdown-metadata-markup (9 51 9 15 15 17 17 51 #<killed buffer>) face (markdown-markup-face markdown-code-face) font-lock-multiline t) 8 42 (markdown-gfm-code (9 802) markdown-metadata-value (9 51 9 15 15 17 17 51 #<killed buffer>) face (markdown-metadata-value-face markdown-code-face) font-lock-multiline t) 42 123 (markdown-gfm-code (9 802) font-lock-multiline t face (markdown-code-face)) 123 182 (markdown-gfm-code (9 802) markdown-metadata-key (128 198 132 191 191 193 193 198 #<killed buffer>) face (markdown-metadata-key-face markdown-code-face) font-lock-multiline t) 182 184 (markdown-gfm-code (9 802) markdown-metadata-markup (128 198 132 191 191 193 193 198 #<killed buffer>) face (markdown-markup-face markdown-code-face) font-lock-multiline t) 184 189 (markdown-gfm-code (9 802) markdown-metadata-value (128 198 132 191 191 193 193 198 #<killed buffer>) face (markdown-metadata-value-face markdown-code-face) font-lock-multiline t) 189 792 (markdown-gfm-code (9 802) font-lock-multiline t face (markdown-code-face))))
  lsp-ui-doc--callback(#<hash-table equal 1/1 0x1ff91422a5f1> (10789 . 10795) #<buffer install.sh>)
  #f(compiled-function (hover) #<bytecode 0x1ff90e6deedd>)(#<hash-table equal 1/1 0x1ff91422a5f1>)
  apply(#f(compiled-function (hover) #<bytecode 0x1ff90e6deedd>) #<hash-table equal 1/1 0x1ff91422a5f1>)
  #f(compiled-function (&rest args) #<bytecode 0x1ff90e6df23d>)(#<hash-table equal 1/1 0x1ff91422a5f1>)
  #f(compiled-function (result) #<bytecode 0x1ff90e6df271>)(#<hash-table equal 1/1 0x1ff91422a5f1>)
  #f(compiled-function (result) #<bytecode 0x1ff90e6da191>)(#<hash-table equal 1/1 0x1ff91422a5f1>)
  lsp--parser-on-message(#<hash-table equal 3/3 0x1ff91422a599> #s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 8/8 0x1ff9119da53d> :registered-server-capabilities nil :root "/Users/nd/.dotfiles" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1ff9141393a5>) :test\? #f(compiled-function () #<bytecode 0x1ff90e53ad45>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x1ff90e53ad51> :request-handlers #<hash-table equal 0/65 0x1ff90e53ae79> :response-handlers #<hash-table eql 11/65 0x1ff9118945d5> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ff91149768d> :action-handlers #<hash-table equal 0/65 0x1ff9120a99bd> :major-modes (sh-mode) :activation-fn nil :priority -1 :server-id bash-ls :multi-root nil :initialization-options nil :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn #f(compiled-function () #<bytecode 0x1ff914139355>) :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x1ff90dbf6f2d> :download-server-fn #f(compiled-function (client callback error-callback update\?) #<bytecode 0x1ff914139369>) :download-in-progress? nil :buffers nil) :host-root nil :proc #<process bash-ls> :cmd-proc #<process bash-ls> :buffers (#<buffer install.sh> #<buffer .zshrc.local> #<buffer .zshrc>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1ff90d681cbd> :watches #<hash-table equal 0/65 0x1ff90d6837b1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x1ff90d683aa9> :work-done-tokens #<hash-table equal 0/65 0x1ff90d683d81>))
  #f(compiled-function (proc input) #<bytecode 0x1ff90d6839e1>)(#<process bash-ls> "Content-Length: 108\15\n\15\n{\"jsonrpc\":\"2.0\",\"method\":\"...")
jcs090218 commented 3 years ago

@douglasdavis @seagle0128 I have applied a solution with PR #547. Can you guys try the latest version?

Let me know if this work!