Skip to content

Weird Sideline Hover Symbol Line Wrap  #661

@llcc

Description

@llcc

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

Activity

bodnarlajos

bodnarlajos commented on Nov 16, 2021

@bodnarlajos

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

wolfwood

wolfwood commented on Jan 20, 2022

@wolfwood

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

bmathieu33

bmathieu33 commented on Feb 2, 2022

@bmathieu33

Isn't this issue like #184?

sam-masaki

sam-masaki commented on May 10, 2022

@sam-masaki

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wolfwood@bmathieu33@llcc@brotzeit@sam-masaki

        Issue actions

          Weird Sideline Hover Symbol Line Wrap · Issue #661 · emacs-lsp/lsp-ui