emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.31k stars 182 forks source link

lsp-ui-doc-glance closes immediately in dap-mode #180

Open rileyrg opened 4 years ago

rileyrg commented 4 years ago

(php)

debug a program using dap-mode.

bring up a doc using lsp-ui-doc-glance.

More often than not it flickers on and immediately off: both with and without the hydra. Sometimes it stays put. I tried playing with position and alignment but neither made a noticeable difference to it remaining on screen.

(lsp-ui-doc-mode 1) works just fine in dap-mode.

If you have time to address this please also consider to decouple lsp-ui-doc-glance from lsp-ui-doc-delay: I think that "glance" should be immediate. My naive solution which "works for me":-

         (defun my-lsp-doc-glance ()
             "Trigger display hover information popup and hide it on next typing."
             (interactive)
             (setq lsp-ui-doc-delay 0)
             (lsp-ui-doc-show)
             (custom-reevaluate-setting 'lsp-ui-doc-delay)
             (add-hook 'pre-command-hook 'lsp-ui-doc--glance-hide-frame))

Enhancement request: ability scroll the doc frame.

yyoncho commented 4 years ago
(defun lsp-ui-doc--glance-hide-frame ()
  "Hook to hide hover information popup for lsp-ui-doc-glance."
  (message "%s" this-command)
  (lsp-ui-doc-hide)
  (remove-hook 'pre-command-hook 'lsp-ui-doc--glance-hide-frame))

If you evaluate this function it will print what is the command that triggers the hiding.

rileyrg commented 4 years ago

its lsp-ui-doc-glance thats calling that. the doc frame appears and vanishes again in dap-mode.

I have a key bound to lsp-ui-mode-map that calls lsp-ui-doc-glance.