emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

Show diagnostics for all lines in lsp-ui-sideline #777

Open zjp opened 1 month ago

zjp commented 1 month ago

I really like how neovim's lsp-ui package displays all diagnostics for all lines, and I'd like to see that behavior in lsp-ui-sideline. I'm halfway through hacking it into my local copy of lsp-ui, so I thought I'd open an issue here and see if this is something you'd be interested in supporting so I can either open a PR when it's done or reorganize my work around monkeypatching lsp-ui in my init config. Let me know!

jcs090218 commented 1 month ago

It depends on the implementation. I cannot guarantee this will be merged, but feel free to open PR so other maintainers can review it.

rickalex21 commented 1 month ago

I too like the way neovim displays all diagnostics. Is there a way to view the doc all the time without having to hover?

On neovim it's there all the time, on Emacs I have to put my cursor on it to see the warning or error.

zjp commented 1 month ago

It depends on the implementation. I cannot guarantee this will be merged, but feel free to open PR so other maintainers can review it.

Sorry, I didn't mean to imply that my changes would just be accepted methodology and sight unseen and I can see how my post came off that way. I should have just actually stated what I was doing so I could get feedback on it as well, but I was trying to save everyone time and quickly check to see if the change would be directionally acceptable for the project or not. Sometimes proposals aren't, like gaps in i3!

My current idea is to check whether a new setting, lsp-ui-sideline--show-all-diagnostics, is t at the end of lsp-ui-sideline and if it is, call a new function, lsp-ui-sideline--run-all, which would loop over all flycheck errors on screen (not in the entire buffer), move the point to that line, and call lsp-ui-sideline--run on them.

One thing I'm stuck on right now is that it doesn't seem possible to give lsp-ui-sideline--find-line an offset that would make it place diagnostics on the same line as the point, and offset diagnostics on lines the point isn't on look a little ridiculous.