lsp-ui icon indicating copy to clipboard operation
lsp-ui copied to clipboard

Scrolling in ui-doc child frame eventually causes Emacs to freeze

Open douglasdavis opened this issue 3 years ago • 2 comments

This is happening to me with the following setup:

  • macOS
  • Emacs 28.0.50 (also freezes on 27.2)
  • pylsp.
  • emacs -Q, load lsp, lsp-ui, and pyenv.

After running M-x lsp in a Python project buffer and hovering over a symbol with a lengthy docstring, if I scroll down through a bit of the child frame Emacs eventually freezes. It's not obvious to me what is triggering the freeze. I'm happy to try any recommended tests.

I tested with lsp-ui-doc-use-webkit set to t (after compiling using --with-xwidgets and the freezing doesn't occur; perhaps there's an issue with the markdown rendering of the default setting.

Another observed feature: the freezing appears to consistently happen when encountering an Examples block in a python docstring, something of the form:

Some description....

Examples
--------
>>> from foo import bar
>>> x = bar()
>>> x * 2
>>> 4

douglasdavis avatar May 25 '21 02:05 douglasdavis

I'm pretty confident now that it's due to the way the >>> lines are getting rendered by markdown. If I surround the example triple back ticks ("```") (i.e. use markdown syntax) the freeze disappears. Unfortunately Python docstrings are more RST like than markdown. After more testing the issue is also not isolated to the presence of >>>'s. Overall it appears to be an issue with markdown, perhaps related to https://github.com/emacs-lsp/lsp-ui/issues/611 but I'm not sure.

douglasdavis avatar May 25 '21 03:05 douglasdavis

I'm seeing the exact same behavior.

System Info :computer:

  • OS: darwin
  • Emacs: 27.2
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 5c88c3b08)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((org :variables org-projectile-file "TODOs.org" org-enable-org-journal-support t)
 dap lsp csv c-c++ q-mode yaml helm emoji osx
 (python :variables python-backend 'lsp python-lsp-server 'pylsp python-formatter 'yapf python-format-on-save t)
 ipython-notebook auto-completion emacs-lisp json git treemacs docker syntax-checking themes-megapack
 (scala :variables scala-backend 'scala-metals scala-auto-treeview nil scala-sbt-window-position 'bottom)
 java)
  • System configuration features: NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER GMP

padraic-mcatee avatar Oct 15 '21 21:10 padraic-mcatee