galaxyline.nvim icon indicating copy to clipboard operation
galaxyline.nvim copied to clipboard

Reusable diagnostic function

Open WhyNotHugo opened this issue 4 years ago • 3 comments

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 avatar Jun 11 '21 17:06 WhyNotHugo

Any feedback here?

WhyNotHugo avatar Jun 30 '21 08:06 WhyNotHugo

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.

ronisbr avatar Aug 07 '21 14:08 ronisbr

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

WhyNotHugo avatar Aug 07 '21 14:08 WhyNotHugo