diff options
| author | Michael Strobel <71396679+Kibadda@users.noreply.github.com> | 2023-08-16 15:49:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-16 08:49:14 -0500 |
| commit | e7801775060e2d8f9f20572fac687f438e81caa0 (patch) | |
| tree | 0b8c6eefffe1dd750b1dab9453a9ef2554dc975a /runtime/doc | |
| parent | 9cb7e00b9748b08fce661f8cbeb06c5994c749ae (diff) | |
| download | rneovim-e7801775060e2d8f9f20572fac687f438e81caa0.tar.gz rneovim-e7801775060e2d8f9f20572fac687f438e81caa0.tar.bz2 rneovim-e7801775060e2d8f9f20572fac687f438e81caa0.zip | |
feat(diagnostic): filter diagnostics by specific severities (#24736)
Allow users to filter diagnostics by specifying severities
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/diagnostic.txt | 13 | ||||
| -rw-r--r-- | runtime/doc/news.txt | 3 |
2 files changed, 14 insertions, 2 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index edbba6ac41..d0aa538011 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -66,7 +66,7 @@ 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 two forms: +|vim.diagnostic.get()|) accept one of three forms: 1. A single |vim.diagnostic.severity| value: >lua @@ -75,8 +75,17 @@ Functions that take a severity as an optional parameter (e.g. 2. A table with a "min" or "max" key (or both): >lua vim.diagnostic.get(0, { severity = { min = vim.diagnostic.severity.WARN } }) +< + This form allows users to specify a range of severities. + +3. A list-like table: >lua -The latter form allows users to specify a range of severities. + vim.diagnostic.get(0, { severity = { + vim.diagnostic.severity.WARN, + vim.diagnostic.severity.INFO, + } }) +< + This form allows users to filter for specific severities ============================================================================== HANDLERS *diagnostic-handlers* diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 576c56f408..483e829770 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -145,6 +145,9 @@ The following new APIs and features were added. • Improved messages for type errors in `vim.api.*` calls (including `opts` params) +• Functions that take a severity as an optional parameter (e.g. + |vim.diagnostic.get()|) now also accept a list of severities |vim.diagnostic.severity| + ============================================================================== CHANGED FEATURES *news-changed* |