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

Weird Sideline Hover Symbol Line Wrap

Open llcc opened this issue 2 years ago • 4 comments

As the following image (red underline) shows, some sideline hover symbols' info has been wrapped to the new line. It seems that the weird behavior is not related with the length of the info, since in some cases even some short info got wrapped.

Screen Shot 2021-10-14 at 7 45 32 AM

llcc avatar Oct 14 '21 00:10 llcc

Hi, I tried to set the height to 0.7 but there is no affect ... I did it because the font-size seems higher then the normal font. image

bodnarlajos avatar Nov 16 '21 08:11 bodnarlajos

I'm also having this issue, using the standalone config from rksm/emacs-rust-config which configures lsp-ui with the sideline

2022-01-20-135115_1278x706_scrot

wolfwood avatar Jan 20 '22 22:01 wolfwood

Isn't this issue like #184?

bmathieu33 avatar Feb 02 '22 16:02 bmathieu33

I had this problem and it was caused by the sideline text using markdown-code-face which inherits from fixed-pitch, which uses the generic Monospace placeholder font family. Looking closer at the two screenshots, it looks like most of the sideline text besides the variable names in boxes are a different font from everything else, so this is probably what's causing it for you here too. If you just set the font family for fixed-pitch to the same as your default font, this issue should go away.

As for how to fix this in general, I'm not sure. lsp-ui-sideline--format-info fontifies the sideline text with lsp--render-element, and that is supposed to render the string with the correct major-mode or as markdown otherwise. Looking at the text that get sent there, its kind is set as markdown and the actual content of the text is a markdown codeblock annotated with the correct language.

I've seen this happen in both rust in python (the only languages I use lsp-mode with) so I don't know if the strings are formatted differently in other language modes.

sam-masaki avatar May 10 '22 05:05 sam-masaki