Open aciceri opened 2 months ago
I assumed this is the default behaviour from sideline.
Sideline doesn't take multiple lines rendering into account since there is no space calculation on the newline (inside the overlay). 🤔
What do you suggest then?
I can add offset to every line except the first line so they at least align along the overlay starting point. 🤔 WDYT?
I don't think there is a good solution for rendering multiple lines on the sideline. I guess the best solution is the set sideline-flymake-max-lines
to 1
.
Keeping everything aligned on the right would be an acceptable solution IMO, it's exactly what helix
does.
Anyway I just realized that sideline-eglot
is a thing, what is the intersection with this sideline-flymake
? Doesn't eglot
relay LSP errors/warnings/etc to flymake
? How does sideline-eglot
behave with errors spanning multiple lines?
Keeping everything aligned on the right would be an acceptable solution IMO, it's exactly what helix does.
Thanks for the suggestion! I'll have to think about this. 🤔
Doesn't eglot relay LSP errors/warnings/etc to flymake? How does sideline-eglot behave with errors spanning multiple lines?
Yes. You will need sideline-eglot
.
I can add offset to every line except the first line so they at least align along the overlay starting point. 🤔 WDYT?
Thanks for your work on this. Is this still an option? I'm currently using the Metals lsp server for Scala and it just won't respect my configuration options to not use multi-line outputs. It would be nice if there was as fall back option to display multi-line outputs. I've currently monkey patched it to concat into a single line but I'm not experienced enough with overlays to provide a proper fix
No, sorry. As I've explained above, there isn't an ideal solution for it, but I might implement the suggested solution (align to the right). However, I've been very busy recently, so it's probably not going to be implemented anytime soon. PRs are always welcome, though!
Thanks for the very quick reply.
I might implement the suggested solution (align to the right).
That would work just as well, I'm really only concerned by the jump from right aligned to left aligned. I could ofc configure flymake to be a left backend instead.
However, I've been very busy recently, so it's probably not going to be implemented anytime soon. PRs are always welcome, though!
No worries at all, I took a rough crack at it tonight but didn't get anywhere. I'll have to do some more reading before I go again. I wouldn't hold your breath for a PR from me, though I might put on up eventually (after university exams)
@jcs090218 I believe that this doesn't work when the
flymake
error takes multiple lines. Consider that I'm usingeglot
with thehaskell-language-server-wrapper
LSP server.In particular looking at the
sideline-flymake--show-errors
it seems that the candidates are always only one i.e. a string potentially containing multiple lines. And this implies thatsideline
shows things horizontally misaligned.Changing the last line of the function to
(funcall callback (split-string text "\n"))
seems to improve a bit the situation but the order is now wrong:Also notice that probably it would make sense removing all the whitespaces a the beginning of each line.
PS: this is my configuration
Haven't tried with
-Q
because I don't think this is due to other packages.