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--move-frame: Wrong type argument: number-or-marker-p, nil #495

Closed CsBigDataHub closed 4 years ago

CsBigDataHub commented 4 years ago

I have been getting lsp-ui-doc--move-frame: Wrong type argument: number-or-marker-p, nil probably after 17f015e commit.

This happens when I run swiper on word-at-point

debug-on-error gives me

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  lsp-ui-doc--mv-at-point(600 31 10 823)
  lsp-ui-doc--move-frame(#<frame  0x7fa257a85e30>)
  lsp-ui-doc--handle-scroll(#<window 3 on warden.py> 4473)
  redisplay_internal\ \(C\ function\)()
  read-from-minibuffer("Swiper: " nil (keymap (keymap (27 keymap (110 . swiper-isearch-thing-at-point)) keymap (s-return . my-swiper-toggle-swiper-isearch) (M-return . my-swiper-toggle-rg-dwim) (C-return . my-swiper-toggle-counsel-rg) (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (37 . swiper-query-replace) (115 . swiper-isearch-toggle) (113 . swiper-query-replace)) (19 . swiper-C-s)) keymap (67108960 . ivy-avy) (23 . ivy-yank-word) (36 . ivy-magic-read-file-env) (3 keymap (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . hydra-ivy/body) (22 . ivy-scroll-up-command) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . ivy-reverse-i-search) (remap keymap (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . ivy-alt-done) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . ivy-dispatching-done) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil swiper-history)
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1fe895c6434d>)("Swiper: " swiper-isearch-function :initial-input nil :keymap (keymap (27 keymap (110 . swiper-isearch-thing-at-point)) keymap (s-return . my-swiper-toggle-swiper-isearch) (M-return . my-swiper-toggle-rg-dwim) (C-return . my-swiper-toggle-counsel-rg) (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (37 . swiper-query-replace) (115 . swiper-isearch-toggle) (113 . swiper-query-replace)) (19 . swiper-C-s)) :dynamic-collection t :require-match t :action swiper-isearch-action :re-builder swiper--re-builder :history swiper-history :extra-props (:fname "/Users/warde...") :caller swiper-isearch)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1fe895c6434d>) ("Swiper: " swiper-isearch-function :initial-input nil :keymap (keymap (27 keymap (110 . swiper-isearch-thing-at-point)) keymap (s-return . my-swiper-toggle-swiper-isearch) (M-return . my-swiper-toggle-rg-dwim) (C-return . my-swiper-toggle-counsel-rg) (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (37 . swiper-query-replace) (115 . swiper-isearch-toggle) (113 . swiper-query-replace)) (19 . swiper-C-s)) :dynamic-collection t :require-match t :action swiper-isearch-action :re-builder swiper--re-builder :history swiper-history :extra-props (:fname "/Users/warde...") :caller swiper-isearch))
  ivy-read("Swiper: " swiper-isearch-function :initial-input nil :keymap (keymap (27 keymap (110 . swiper-isearch-thing-at-point)) keymap (s-return . my-swiper-toggle-swiper-isearch) (M-return . my-swiper-toggle-rg-dwim) (C-return . my-swiper-toggle-counsel-rg) (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (37 . swiper-query-replace) (115 . swiper-isearch-toggle) (113 . swiper-query-replace)) (19 . swiper-C-s)) :dynamic-collection t :require-match t :action swiper-isearch-action :re-builder swiper--re-builder :history swiper-history :extra-props (:fname "/Users/warde...") :caller swiper-isearch)
  swiper-isearch()
  funcall-interactively(swiper-isearch)
  call-interactively(swiper-isearch nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x426401bd>)(swiper-isearch nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x426401bd>) swiper-isearch)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x426401bd>) swiper-isearch)
  command-execute(swiper-isearch)
sebastiencs commented 4 years ago

@CsBigDataHub I think it was caused by https://github.com/emacs-lsp/lsp-ui/commit/6f64b85e4df3e1346aca5a3e7acfd6ad3d9d32e3. It should be fixed with https://github.com/emacs-lsp/lsp-ui/commit/815d0c6f5003f85974d82ee9d8872a342f5fadf4

elbaulp commented 4 years ago

I am getting something similar:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  lsp-ui-doc--mv-at-point(160 24 720 0)
  lsp-ui-doc--move-frame(#<frame  0x7ff0fb85ba60>)
  lsp-ui-doc--handle-scroll(#<window 3 on filename.py> 1)
  redisplay_internal\ \(C\ function\)()

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  lsp-ui-doc--mv-at-point(216 24 8 802)
  lsp-ui-doc--move-frame(#<frame  0x7fb6a628a120>)
  lsp-ui-doc--handle-scroll(#<window 3 on filename.py> 1)
  redisplay_internal\ \(C\ function\)()
  read-from-minibuffer(#("Find files or url: " 0 19 (face helm-minibuffer-prompt)) "/Users/........." (keymap (26 . helm-select-action) (tab . helm-execute-persistent-action) (f13 lambda nil (interactive) (helm-select-nth-action 12)) (f12 lambda nil (interactive) (helm-select-nth-action 11)) (f11 lambda nil (interactive) (helm-select-nth-action 10)) (f10 lambda nil (interactive) (helm-select-nth-action 9)) (f9 lambda nil (interactive) (helm-select-nth-action 8)) (f8 lambda nil (interactive) (helm-select-nth-action 7)) (f7 lambda nil (interactive) (helm-select-nth-action 6)) (f6 lambda nil (interactive) (helm-select-nth-action 5)) (f5 lambda nil (interactive) (helm-select-nth-action 4)) (f4 lambda nil (interactive) (helm-select-nth-action 3)) (f3 lambda nil (interactive) (helm-select-nth-action 2)) (f2 lambda nil (interactive) (helm-select-nth-action 1)) (menu-bar keymap (help-menu keymap (describe keymap (describe-mode . helm-help)))) (help keymap (109 . helm-help)) (23 . #f(compiled-function () (interactive nil) #<bytecode 0x1fedaab07f75>)) (f1 lambda nil (interactive) (helm-select-nth-action 0)) (8 keymap (109 . helm-help) (104 . undefined) (8 . undefined) (99 . helm-customize-group) (4 . helm-enable-or-switch-to-debug)) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap (57 . helm-execute-selection-action-at-nth-+9) (56 . helm-execute-selection-action-at-nth-+8) (55 . helm-execute-selection-action-at-nth-+7) (54 . helm-execute-selection-action-at-nth-+6) (53 . helm-execute-selection-action-at-nth-+5) (52 . helm-execute-selection-action-at-nth-+4) (51 . helm-execute-selection-action-at-nth-+3) (50 . helm-execute-selection-action-at-nth-+2) (49 . helm-execute-selection-action-at-nth-+1) (63 . helm-help) (110 . #f(compiled-function () (interactive nil) #<bytecode 0x1fedaab07bdd>)) (108 . helm-display-line-numbers-mode) (62 . helm-toggle-truncate-line) (21 . helm-refresh) (6 . helm-follow-mode) (9 . helm-copy-to-buffer) (11 . helm-kill-selection-and-quit) (25 . helm-yank-selection) (37 . helm-exchange-minibuffer-and-header-line) (95 . helm-toggle-full-frame) (45 . helm-swap-windows)) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (19 . undefined) (24 keymap (57 . helm-execute-selection-action-at-nth-+9) (56 . helm-execute-selection-action-at-nth-+8) (55 . helm-execute-selection-action-at-nth-+7) (54 . helm-execute-selection-action-at-nth-+6) (53 . helm-execute-selection-action-at-nth-+5) (52 . helm-execute-selection-action-at-nth-+4) (51 . helm-execute-selection-action-at-nth-+3) (50 . helm-execute-selection-action-at-nth-+2) (49 . helm-execute-selection-action-at-nth-+1) (2 . helm-resume-list-buffers-after-quit) (98 . helm-resume-previous-session-after-quit) (6 . helm-quit-and-find-file)) (11 . helm-delete-minibuffer-contents) (67108896 . helm-toggle-visible-mark-forward) (0 . helm-toggle-visible-mark) (C-M-up . helm-scroll-other-window-down) (C-M-down . helm-scroll-other-window) (M-prior . helm-scroll-other-window-down) (M-next . helm-scroll-other-window) (12 . helm-recenter-top-bottom-other-window) (left . helm-previous-source) (right . helm-next-source) (15 . helm-next-source) (10 . helm-execute-persistent-action) (9 . helm-execute-persistent-action) (13 . helm-maybe-exit-minibuffer) (7 . helm-keyboard-quit) (22 . helm-next-page) (27 keymap (110 . next-history-element) (112 . previous-history-element) (115 . undefined) (5 . helm-display-all-sources) (1 . helm-show-all-candidates-in-source) (85 . helm-unmark-all) (97 . helm-mark-all) (109 . helm-toggle-all-marks) (41 . helm-next-visible-mark) (40 . helm-prev-visible-mark) (91) (32 . helm-toggle-visible-mark-backward) (33554454 . helm-scroll-other-window-down) (25 . helm-scroll-other-window-down) (22 . helm-scroll-other-window) (12 . helm-reposition-window-other-window) (111 . helm-previous-source) (62 . helm-end-of-buffer) (60 . helm-beginning-of-buffer) (118 . helm-previous-page)) (next . helm-next-page) (prior . helm-previous-page) (C-up . helm-follow-action-backward) (C-down . helm-follow-action-forward) (16 . helm-previous-line) ...) nil nil "/Users/........." t)
  helm-read-pattern-maybe("Find files or url: " "/Users/........." "^filename\\.py" nil nil "/Users/........." nil)
  helm-internal(helm-source-find-files "/Users/........." "Find files or url: " nil "^filename\\.py" "*helm find files*" nil "/Users/........." nil)
  apply(helm-internal (helm-source-find-files "/Users/........." "Find files or url: " nil "^filename\\.py" "*helm find files*" nil "/Users/........." nil))
  helm(helm-source-find-files "/Users/........." "Find files or url: " nil "^filename\\.py" "*helm find files*" nil "/Users/........." nil)
  apply(helm (helm-source-find-files "/Users/........." "Find files or url: " nil "^filename\\.py" "*helm find files*" nil "/Users/........." nil))
  helm(:sources helm-source-find-files :input "/Users/........." :case-fold-search t :preselect "^filename\\.py" :ff-transformer-show-only-basename t :default "/Users/........." :prompt "Find files or url: " :buffer "*helm find files*")
  helm-find-files-1("/Users/........." "^filename\\.py")
  helm-find-files(nil)
  funcall-interactively(helm-find-files nil)
  call-interactively(helm-find-files nil nil)
  command-execute(helm-find-files)
CsBigDataHub commented 4 years ago

@elbaulp , can you please check if you are using the latest version of the package.

This is the latest version in Melpa 20200901.1649. Please confirm.

elbaulp commented 4 years ago

How can I do that? I am using straight, so the repo is up to date, this is the HEAD of my local repo right now

815d0c6 (HEAD -> master, origin/master, origin/HEAD) [lsp-ui-doc] Handle when point changed after scroll #495

CsBigDataHub commented 4 years ago

@elbaulp , if you use straight and want to get the latest version you will need

since you already have latest changes try straight-rebuild-package and restart Emacs to check if the issue still persists.

elbaulp commented 4 years ago

Yes, it persists, but seems to be gone if I configure lsp-us-doc to show the information on the top-right corner of the window. -- Alejandro Alcalde - elbauldelprogramador.com http://elbauldelprogramador.com/en

On Thu, Sep 3, 2020 at 6:19 PM CsBigDataHub notifications@github.com wrote:

@elbaulp https://github.com/elbaulp , if you use straight and want to get the latest version you will need

  • straight-pull-package to pull latest changes
  • straight-rebuild-package to rebuild the package with latest changes.

since you already have latest changes try straight-rebuild-package and restart Emacs to check if the issue still persists.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/emacs-lsp/lsp-ui/issues/495#issuecomment-686603168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADAMLOMWTX5EWDFZSCEGE3SD66YRANCNFSM4QR4ULAQ .

sebastiencs commented 4 years ago

@elbaulp I'm not sure how straight works, but can you try to recompile lsp-ui with: (M-:)

(byte-recompile-directory (file-name-directory (find-library-name "lsp-ui")) 0 t)

See if the issue still occurs

jcs090218 commented 4 years ago

I am getting error too because have multiple windows at a time. I guess there is some kind of miscalculation when multiple windows coexist.

I am also getting this weird behaviour. See gif file below.

ezgif-5-e5ca6474d1dc

You can see the tooltip isn't in the correct position. I am setting lsp-ui-doc-position to 'at-point. Notice if I switch one of the buffer without lsp-mode enabled; everything goes fine.

sebastiencs commented 4 years ago

I am getting error too because have multiple windows at a time. I guess there is some kind of miscalculation when multiple windows coexist.

This is about the original issue, right ? If so, can you please make a gif of when this happens and also provide a backtrace (with M-x toggle-debug-on-error), unless it's the same than posted by @elbaulp and @CsBigDataHub .

You can see the tooltip isn't in the correct position. I am setting lsp-ui-doc-position to 'at-point. Notice if I switch one of the buffer without lsp-mode enabled; everything goes fine.

I'm also using different windows and I just made some tests, I can't reproduce the behavior I see on the gif. Could you try to disable your other packages and see if it still occurs. Also, what emacs version are you using, and what windows manager ?

thierryvolpiatto commented 4 years ago

Modifying lsp-ui-doc--handle-scroll fix it for Helm:

diff --git a/lsp-ui-doc.el b/lsp-ui-doc.el
index 2dac778..d04b600 100644
--- a/lsp-ui-doc.el
+++ b/lsp-ui-doc.el
@@ -825,6 +825,7 @@ before, or if the new window is the minibuffer."
          (eq lsp-ui-doc-position 'at-point)
          (frame-visible-p frame)
          (if (and lsp-ui-doc--bounds
+                  (not (minibufferp (window-buffer)))
                   (>= (point) (car lsp-ui-doc--bounds))
                   (<= (point) (cdr lsp-ui-doc--bounds)))
              (lsp-ui-doc--move-frame frame)
jcs090218 commented 4 years ago

@thierryvolpiatto You are amazing! This does solve the issue!

This is about the original issue, right ? If so, can you please make a gif of when this happens and also provide a backtrace (with M-x toggle-debug-on-error), unless it's the same than posted by @elbaulp and @CsBigDataHub .

Sorry that I haven't have time to test. But I think @thierryvolpiatto has solved it.

sebastiencs commented 4 years ago

Thank you @thierryvolpiatto, it should be fixed on master with https://github.com/emacs-lsp/lsp-ui/commit/b69922a7fb6793c2ba1ad6aa9bcee0a24211ae06

elbaulp commented 4 years ago

Thank you @thierryvolpiatto !!

CsBigDataHub commented 4 years ago

Thanks @thierryvolpiatto. @sebastiencs you can close the issue if it is fixed. Thanks all for your effort.

thierryvolpiatto commented 4 years ago

Sebastien Chapuis notifications@github.com writes:

Thank you @thierryvolpiatto, it should be fixed on master with b69922a

(eq (window-buffer) (frame-parameter frame 'lsp-ui-doc--buffer-origin))

This is true when position of lsp-ui-doc frame is on the new buffer (helm or whatever), as a result if frame is outside it is not hidden. Whereas (not (minibufferp (window-buffer))) test hide the frame in any case (always true).

-- Thierry

thierryvolpiatto commented 4 years ago

This become annoying when one for example run in helm a persistent action. Start for example helm-M-x, the child frame is here but not annoying: Capture d’écran_2020-09-07_10-30-05 but become annoying when execute persistent action: Capture d’écran_2020-09-07_10-25-37

sebastiencs commented 4 years ago

@thierryvolpiatto Good point, thanks

thierryvolpiatto commented 4 years ago

I meant you should not check at all (eq (window-buffer) (frame-parameter frame 'lsp-ui-doc--buffer-origin)), with this it changes nothing.

diff --git a/lsp-ui-doc.el b/lsp-ui-doc.el
index 331676e..d04b600 100644
--- a/lsp-ui-doc.el
+++ b/lsp-ui-doc.el
@@ -825,7 +825,6 @@ before, or if the new window is the minibuffer."
          (eq lsp-ui-doc-position 'at-point)
          (frame-visible-p frame)
          (if (and lsp-ui-doc--bounds
-                  (eq (window-buffer) (frame-parameter frame 'lsp-ui-doc--buffer-origin))
                   (not (minibufferp (window-buffer)))
                   (>= (point) (car lsp-ui-doc--bounds))
                   (<= (point) (cdr lsp-ui-doc--bounds)))

Thanks.

thierryvolpiatto commented 4 years ago

No, finally I am wrong, it changes nothing when the child frame is located on the very top of parent frame, so forget it, it is really usable like this. Think I have finished configuring lsp for now, thanks all for lsp-mode.