From 711f3cc299d8bedc46653a97d2b985aa18ec4925 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Thu, 16 Apr 2026 17:32:35 +0300 Subject: [PATCH] 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. --- runtime/doc/diagnostic.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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