emacs-lsp / lsp-ui

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

lsp-ui pop ups frequently only display a small part of the contents #562

Closed RKBK closed 3 years ago

RKBK commented 3 years ago

Describe the bug Using lsp-mode with vls and javascript-eslint, with lsp-ui, enables helpful documentation pop ups. However, the pop ups often have certain size, yet only a smaller part of the total size contains the actual information. The information is not fully visible. See example, snapped from a current lsp-mode session in a typescript file: image

Cycling the pop up (i.e. moving the cursor back and forth onto the same symbol) will make the box work maybe half the time. If you up-arrow, down-arrow between two symbols, it's almost like the size of the box doesn't get correctly calculated and updated for each symbol. One symbol might have less documentation, and a smaller window, and then when you switch to a symbol with more documentation it keeps the smaller box from the previous symbol.

To Reproduce Open any ts file with ls-ts as language server and using lsp-ui.

Expected behavior The documentation should completely fill the ui box and all text should be visible.

Which Language Server did you use vls and eslint, or ts-ls and eslint

OS Windows subsystem for linux running Ubuntu 20.04 together with the x server vcxsrv.

Error callstack There are no errors.

jcs090218 commented 3 years ago

Hmm... What version of lsp-ui are you using? I can't seem to reproduce this issue. 😕

RKBK commented 3 years ago

@jcs090218 This happens with the very latest version of lsp-ui, 20210118.436 . I'm using emacs 27.1 (from this ppa: https://launchpad.net/~kelleyk/+archive/ubuntu/emacs)

These are my current lsp-related packages

  helm-lsp           20200910.518  installed             LSP helm integration
  lsp-java           20210105.1625 installed             Java support for lsp-mode
  lsp-mode           20210120.2145 installed             LSP mode
  lsp-treemacs       0.3           installed             LSP treemacs
  lsp-ui             20210118.436  installed             UI modules for lsp-mode
  posframe           0.8.4         installed             Pop a posframe (just a frame) at point
  treemacs           20210118.1552 installed             A tree style file explorer package

I've found out that it uses emacs child frames. In the documentation for child frames, it says that it either uses a new child frame, or reuses the size of the previous child frame. Is the latter being done when it is not appropriate?

RKBK commented 3 years ago

Another user reported the same issue, but additionally, had identified that the cause was the x-server used, VcXsrv:

https://stackoverflow.com/questions/59632106/emacs-weird-rendering-of-child-frames

I'm closing this issue, as it's probably not related to lsp-ui.

RKBK commented 3 years ago

If anyone has the same issue in the future, I just realized that you can use the Cygwin Xserver: https://x.cygwin.com/

You have to use launch arguments (what is in the "Target" field in the shortcut) like these C:\cygwin\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin -- -listen tcp -nowgl -ac"

(I'm not 100% sure --listen tcp is needed if you run wsl 1, I just did what was recommended here: https://gojimmypi.blogspot.com/2019/01/wsl-gui-using-cygwin-x-server-for.html)

The -ac flag turns off access control, which might not be secure in every situation.

With the cygwin x server, the frame size is correct!