From 126ef65e5b3ff0da68bfe166be0bb0a33664142b Mon Sep 17 00:00:00 2001 From: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com> Date: Sun, 20 Nov 2022 23:57:36 +0000 Subject: feat(diagnostic): add `suffix` option to `virt_text` config (#21140) This introduces a `suffix` option to the `virt_text` config in `vim.diagnostic.config()`. The suffix can either be a string which is appended to the diagnostic message or a function returning such. The function receives a `diagnostic` argument, which is the diagnostic table of the last diagnostic (the one whose message is rendered as virt text). --- runtime/doc/diagnostic.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 53046b399f..a2bacebc72 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -365,6 +365,11 @@ config({opts}, {namespace}) *vim.diagnostic.config()* the beginning of the virtual text. • prefix: (string) Prepend diagnostic message with prefix. + • suffix: (string or function) Append diagnostic + message with suffix. If a function, it must have the + signature (diagnostic) -> string, where {diagnostic} + is of type |diagnostic-structure|. This can be used + to render an LSP diagnostic error code. • format: (function) A function that takes a diagnostic as input and returns a string. The return value is the text used to display the diagnostic. Example: > -- cgit