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

Reusable diagnostic function #184

Closed
wants to merge 3 commits into from
Closed

Reusable diagnostic function #184

wants to merge 3 commits into from

Conversation

WhyNotHugo
Copy link

This changeset exposes a function get_diagnostic(diag_type). It returns a number (unlike get_diagnostic_* functions, which return a formatted string).

I did a tiny refactor here, and:

  • Both get_coc_diagnostic and get_nvim_lsp_diagnostic now both return a number (previously both returned a string, but only the former appended a space, which was a minor inconsistency).
  • I've de-duplicated some logic by introducing get_formatted_diagnostic. It also ensures all values are formatted the same.

This is mostly since I want to be able to use something like get_diagnostic("Info") + get_diagnostic("Hint"). The existing functions return strings, so doing math on them is unnecessarily complicated.

@WhyNotHugo
Copy link
Author

Any feedback here?

@ronisbr
Copy link

ronisbr commented Aug 7, 2021

Any feedback here?

Last time @glepnir wrote something in Github, he said he was in a hospital. It was 16 days ago. I hope he is fine.

@WhyNotHugo
Copy link
Author

Oh, thanks for the heads up, I had no idea. Hope he gets well.

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

Successfully merging this pull request may close these issues.

2 participants