lsp-ui
lsp-ui copied to clipboard
Is there a way to show diagnostics in popup?
Right now my diagnostics are getting shown in the sideline, but that can become quite a mess when window doesn't have big width, and sideline contains a lot of info (code actions, errors, ...).
I can get turn off the sideline and then it shows in the minibuffer, but it doesn't behave much nicer -> I lose colors, formatting is also not great.
Is there a way to show diagnostics in the popup that would show up either at the fixed position, or at the cursor? Right now we already have popups for docs, could we also use them to show diagnostics?
Or if now, is there a way to make diagnostics in sideline to behave nicer? To explain what do I mean by messy right now, here is a screenshot:

- one problem is that text is right-aligned so it looses its natural structure, makes it harder to read.
- long lines go into multiple lines
Indeed for diagnostics, in particular compiler error messages, the sideline is not that helpful. I don't have the editor window full screen, so even with a Lsp Ui Sideline Diagnostic Max Line Length of 150 many compiler error message fall off the screen to the right.
You can turn off the diagnostic by setting lsp-ui-sideline-show-diagnostics to nil.
You can turn off the diagnostic by setting
lsp-ui-sideline-show-diagnosticstonil.
What do I get with that though -> they start showing in minibuffer, right?
What I was hoping for instead was to have them in the popup, or on the sideline but better formatted.
What do I get with that though -> they start showing in minibuffer, right?
No, it depends on the value of the variable flycheck-display-errors-function. The default value is #'flycheck-display-error-messages, so you will see it in the minibuffer.
What I was hoping for instead was to have them in the popup, or on the sideline but better formatted.
Here are some alternatives:
- sideline + sideline-flycheck (this is the one I used/created)
- flycheck-popup-tip
- flycheck-pos-tip
- flycheck-posframe
I tried flycheck-popup-tip as well as flycheck-posframe and both have problems with flycheck-next/previous-error.
- The first one has a post-command hook which seems to immediately remove the popup again.
- The second one show the popup only if the flycheck-next-error jumps to a position which does not need scrolling. If scrolling is needed, no popup is shown.
Both work when using cursor movement to walk the cursor onto a point where flycheck has marked an error.
I am not asking anyone to investigate this, as reasons may still be found in my peculiar setup, but the above may safe someone some head scratching when seeing the same problems.