Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to show diagnostics in popup? #735

Open
Martinsos opened this issue Oct 13, 2022 · 5 comments
Open

Is there a way to show diagnostics in popup? #735

Martinsos opened this issue Oct 13, 2022 · 5 comments

Comments

@Martinsos
Copy link

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:

image

  • 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
@HaraldKi
Copy link

HaraldKi commented Mar 9, 2024

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.

@jcs090218
Copy link
Member

You can turn off the diagnostic by setting lsp-ui-sideline-show-diagnostics to nil.

@Martinsos
Copy link
Author

You can turn off the diagnostic by setting lsp-ui-sideline-show-diagnostics to nil.

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.

@jcs090218
Copy link
Member

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:

@HaraldKi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants