Home Explore Blog CI



neovim

8th chunk of `runtime/doc/diagnostic.txt`
f233b5324ff626cbca94eef4f4c711ca20461a019ee497f20000000100000fc2
 `table`: Enable this feature with overrides. Use an empty table to use
      default values.
    • `function`: Function with signature (namespace, bufnr) that returns any
      of the above.

    Fields: ~
      • {underline}?         (`boolean|vim.diagnostic.Opts.Underline|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.Underline`, default: `true`)
                             Use underline for diagnostics.
      • {virtual_text}?      (`boolean|vim.diagnostic.Opts.VirtualText|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.VirtualText`, default: `false`)
                             Use virtual text for diagnostics. If multiple
                             diagnostics are set for a namespace, one prefix
                             per diagnostic + the last diagnostic message are
                             shown.
      • {virtual_lines}?     (`boolean|vim.diagnostic.Opts.VirtualLines|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.VirtualLines`, default: `false`)
                             Use virtual lines for diagnostics.
      • {signs}?             (`boolean|vim.diagnostic.Opts.Signs|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.Signs`, default: `true`)
                             Use signs for diagnostics |diagnostic-signs|.
      • {float}?             (`boolean|vim.diagnostic.Opts.Float|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.Float`)
                             Options for floating windows. See
                             |vim.diagnostic.Opts.Float|.
      • {update_in_insert}?  (`boolean`, default: `false`) Update diagnostics
                             in Insert mode (if `false`, diagnostics are
                             updated on |InsertLeave|)
      • {severity_sort}?     (`boolean|{reverse?:boolean}`, default: `false`)
                             Sort diagnostics by severity. This affects the
                             order in which signs, virtual text, and
                             highlights are displayed. When true, higher
                             severities are displayed before lower severities
                             (e.g. ERROR is displayed before WARN). Options:
                             • {reverse}? (boolean) Reverse sort order
      • {jump}?              (`vim.diagnostic.Opts.Jump`) Default values for
                             |vim.diagnostic.jump()|. See
                             |vim.diagnostic.Opts.Jump|.

*vim.diagnostic.Opts.Float*

    Fields: ~
      • {bufnr}?          (`integer`, default: current buffer) Buffer number
                          to show diagnostics from.
      • {namespace}?      (`integer|integer[]`) Limit diagnostics to the given
                          namespace(s).
      • {scope}?          (`'line'|'buffer'|'cursor'|'c'|'l'|'b'`, default:
                          `line`) Show diagnostics from the whole buffer
                          (`buffer"`, the current cursor line (`line`), or the
                          current cursor position (`cursor`). Shorthand
                          versions are also accepted (`c` for `cursor`, `l`
                          for `line`, `b` for `buffer`).
      • {pos}?            (`integer|[integer,integer]`) If {scope} is "line"
                          or "cursor", use this position rather than the
                          cursor position. If a number, interpreted as a line
                          number; otherwise, a (row, col) tuple.
      • {severity_sort}?  (`boolean|{reverse?:boolean}`, default: `false`)
                          Sort diagnostics by severity. Overrides the setting
                          from |vim.diagnostic.config()|.
      • {severity}?       (`vim.diagnostic.SeverityFilter`) See
                          |diagnostic-severity|. Overrides the setting from
                          |vim.diagnostic.config()|.
      • {header}?         (`string|[string,any]`) String to use as the header
                  

Title: Detailed Diagnostic Options: Display and Behavior
Summary
This section continues the description of `vim.diagnostic.Opts`, focusing on options to control diagnostic display and behavior in Neovim. It covers: using underlines, virtual text, and virtual lines for diagnostics; enabling signs in the gutter; configuring floating window options; updating diagnostics in insert mode; sorting diagnostics by severity, and setting default values for jumping between diagnostics. It further elaborates on `vim.diagnostic.Opts.Float`, specifying options for the floating window, including limiting diagnostics by buffer and namespace, setting the scope (line, buffer, cursor), providing a custom position, sorting by severity, filtering by severity, and setting the header.