Open jtl5770 opened 4 years ago
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...
What do you mean by visual line mode? You want toggle-truncate-lines
to be set to wrap?
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).
@abo-abo we are using lv package for displaying signature help
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?
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
@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.
Here it is how it looks on my side
sorry to ask something most probably obvious: How do I provide a log?
@jtl5770 (setq lsp-print-io t)
and then lsp-workspace-show-log
.
@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...
@yyoncho I've just added lv-window-hook
. You can set it up to turn on visual-line-mode
.
@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: well, updated everything from MELPA - but it simply doesn't work. I added to the hook as described, no effect...
@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
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