[X] You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain
Bug description
Using lsp-mode with clangd, and pointing anything at `lsp-describe-thing-at-point' I see trailing whitespace in the resulting buffer.
I notice because some of the faces being used use underline which extends past the end of the line.
Looking at the definition of `lsp-describe-thing-at-point' we see the actual buffer is inserted with:
which strips whitespace out of the last line only. Changing this to use split/trim/mapconcat works as expected, but I'm unsure looking at the code if the whitespace shouldn't be stripped by lsp--render-on-hover-content directly. If not, I would provide a PR.
Steps to reproduce
Try to open/describe any C variable by using `lsp-describe-thing-at-point' with clangd.
A plain C file with:
float PI = 3.1415926f;
shows:
Expected behavior
The description shouldn't contain trailing whitespace.
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
Using lsp-mode with clangd, and pointing anything at `lsp-describe-thing-at-point' I see trailing whitespace in the resulting buffer. I notice because some of the faces being used use underline which extends past the end of the line.
Looking at the definition of `lsp-describe-thing-at-point' we see the actual buffer is inserted with:
(insert (string-trim-right (lsp--render-on-hover-content contents t)))))
which strips whitespace out of the last line only. Changing this to use split/trim/mapconcat works as expected, but I'm unsure looking at the code if the whitespace shouldn't be stripped by lsp--render-on-hover-content directly. If not, I would provide a PR.
Steps to reproduce
Try to open/describe any C variable by using `lsp-describe-thing-at-point' with clangd. A plain C file with:
shows:
Expected behavior
The description shouldn't contain trailing whitespace.
Which Language Server did you use?
lsp-clangd
OS
Linux
Error callstack
No response
Anything else?
No response