nvim_runtime_lua

vim.diagnostic._severity

Methods4

function _severity.to_severity(value: string | vim.diagnostic.Severity | nil) -> vim.diagnostic.Severity | nil
function _severity.severity_predicate(filter: vim.diagnostic.SeverityFilter) -> fun(d: vim.Diagnostic) -> boolean
function _severity.filter_by_severity(filter: vim.diagnostic.SeverityFilter | nil, diagnostics: vim.Diagnostic[]) -> vim.Diagnostic[]
function _severity.match(str: string, pat: string, groups: string[], severity_map: nil | table, defaults: nil | table) -> vim.Diagnostic | nil

Parse a diagnostic from a string.

Parameters
strstring

String to parse diagnostics from.

patstring

Lua pattern with capture groups.

groupsstring[]

List of fields in a |vim.Diagnostic| structure to associate with captures from {pat}.

severity_mapnil | table

A table mapping the severity field from {groups} with an item from |vim.diagnostic.severity|.

defaultsnil | table

Table of default values for any fields not listed in {groups}.

Returns