diff options
| author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2026-04-16 17:32:35 +0300 |
|---|---|---|
| committer | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2026-04-16 16:05:12 +0000 |
| commit | 9d66c7828edc159a83562226b22f43ca5b94c94d (patch) | |
| tree | 386057d306534955394c550d7cb2b86824cf82dd | |
| parent | 5f23c0a1cfa9136417a8a3443b280f134cd99216 (diff) | |
docs(diagnostic): severity names are sometimes allowed #39120
Problem: Using severity names (like "ERROR", "WARN") in functions like
`vim.diganostic.get()` and `vim.diagnostic.config()` is allowed and
tested for many years now. But documentation about it can be clearer.
Solution: Explicitly mention that severity names are allowed in some
situations. Ideally, it would also require updating typing for
`vim.diagnostic.SeverityFilter`, but that looks problematic to do
robustly.
(cherry picked from commit 711f3cc299d8bedc46653a97d2b985aa18ec4925)
| -rw-r--r-- | runtime/doc/diagnostic.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 98bbb07623..80d4ae77b4 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -48,7 +48,8 @@ The "severity" key in a diagnostic is one of the values defined in vim.diagnostic.severity.HINT Functions that take a severity as an optional parameter (e.g. -|vim.diagnostic.get()|) accept one of three forms: +|vim.diagnostic.get()|) allow using severity names (like "ERROR") as well as +values and accept one of three forms: 1. A single |vim.diagnostic.severity| value: >lua |
