Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signature help with lv is nor word wrapping too long documentation lines (seen with java doc) #1216

Open
jtl5770 opened this issue Dec 3, 2019 · 15 comments

Comments

@jtl5770
Copy link

jtl5770 commented Dec 3, 2019

The signature help using lv is pretty neat, unfortunately it doesn't work too well with java doc as the content often has long lines which are not word wrapped, but truncated which is hard to follow. And if I turn on word wrapping in that buffer, the nice ascii graphics with the "header line" and the vertical line on the left is being broken.

To Reproduce
Use it on a signature with java-doc whose contents is longer than fits a line.

Expected behavior
I would expect lines either being broken and wrapped unconditionally, or and option to do so and by doing that, the arrangement and display of the help should not be broken

Which Language Server did you use
eclipse for java

OS
Linux

@yyoncho yyoncho closed this as completed in 6ccf367 Dec 4, 2019
@jtl5770
Copy link
Author

jtl5770 commented Dec 4, 2019

But it still leaves the question how automatically enable visual line mode to break long lines into words...

Seems it's in fundamental mode, so I don't want to just add it to this mode's hook...

@yyoncho
Copy link
Member

yyoncho commented Dec 4, 2019

What do you mean by visual line mode? You want toggle-truncate-lines to be set to wrap?

@yyoncho yyoncho reopened this Dec 4, 2019
@jtl5770
Copy link
Author

jtl5770 commented Dec 5, 2019

Actually what ever happens when you use select "Word Wrap (Visual Line Mode)" from the "Options->Line Wrapping in this Buffer" Menu. I assume it is the same as M-x visual-line-mode:

Not just wrap a line at whatever character is at the end of the line length (and having those ugly continuation arrows). Visual line mode makes sure to wrap at word boundaries (and also takes care of cursor movement to not see only one, continued line - not important for our case here).

@yyoncho
Copy link
Member

yyoncho commented Dec 5, 2019

@abo-abo we are using lv package for displaying signature help
Screenshot

What do you think about having visual-line-mode enabled by default in lv window as suggested by @jtl5770 ? I could patch it on lsp-mode side(or eventually duplicate the lv implementation?) but IMO it will be useful for other packages using lv too. WDYT?

@jtl5770
Copy link
Author

jtl5770 commented Dec 12, 2019

Screenshot from 2019-12-12 12-50-26
Hi @yyoncho - besides the fact of the non wrapping lines, I assume there is another problem with the formatting of the signature help (see screenshot). I would assume that

  • there is no newline after the the bullet point
  • The "parameters:" should start a new line
    and I don't know where the ugly public_boolean_startsWith(String <>_prefix) is coming from (and if this is intentional to be written like that)

@yyoncho
Copy link
Member

yyoncho commented Dec 12, 2019

@jtl5770 can you provide the log for this call? I think I have seen similar issues in the past and back then it was caused by markdown-mode.

@yyoncho
Copy link
Member

yyoncho commented Dec 12, 2019

Here it is how it looks on my side

Screenshot

@jtl5770
Copy link
Author

jtl5770 commented Dec 12, 2019

sorry to ask something most probably obvious: How do I provide a log?

@yyoncho
Copy link
Member

yyoncho commented Dec 12, 2019

@jtl5770 (setq lsp-print-io t) and then lsp-workspace-show-log.

@jtl5770
Copy link
Author

jtl5770 commented Dec 12, 2019

io.log

hope this helps....

@jtl5770
Copy link
Author

jtl5770 commented Dec 12, 2019

@yyoncho - maybe you can save the hassle... I realized I had openjdk-1.8 installed. I switched to some more reasonable openjdk-11 and the formatting of the javadocs looks like your example. Maybe there is no need to support archaic versions here...

abo-abo added a commit to abo-abo/hydra that referenced this issue Dec 14, 2019
Re emacs-lsp/lsp-mode#1216

Example:

    (add-hook 'lv-window-hook 'visual-line-mode)
@abo-abo
Copy link

abo-abo commented Dec 14, 2019

@yyoncho I've just added lv-window-hook. You can set it up to turn on visual-line-mode.

@yyoncho
Copy link
Member

yyoncho commented Dec 14, 2019

@abo-abo thank you!

@jtl5770 here it is the code to use to enable visual-line-mode:

(add-hook 'lv-window-hook 'visual-line-mode)

@yyoncho yyoncho closed this as completed Dec 14, 2019
@jtl5770
Copy link
Author

jtl5770 commented Dec 14, 2019

@yyoncho: well, updated everything from MELPA - but it simply doesn't work. I added to the hook as described, no effect...

@jtl5770
Copy link
Author

jtl5770 commented Jan 27, 2020

@yyoncho - I tried again in the hope I made something wrong the first time.. but no: visual-line-hook is added to lv-window-hook, but no effect.

I tried with melpa up to date as of today, with Java. E.g. using completion on a method showed the signature help for the arguments with lines not wrapped, and by that mostly useless to really read the documentation.
Are you sure this is worling? Where could I look for mistakes on my side?

Regards, jtl

@yyoncho yyoncho reopened this Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants