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
strstringString to parse diagnostics from.
patstringLua pattern with capture groups.
groupsstring[]List of fields in a |vim.Diagnostic| structure to associate with captures from {pat}.
severity_mapnil | tableA table mapping the severity field from {groups} with an item from |vim.diagnostic.severity|.
defaultsnil | tableTable of default values for any fields not listed in {groups}.
Returns
- vim.Diagnostic | nil