aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/diagnostic.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/diagnostic.txt')
-rw-r--r--runtime/doc/diagnostic.txt67
1 files changed, 26 insertions, 41 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 1dd9c4f301..9a65737dae 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -239,7 +239,7 @@ DiagnosticUnderlineHint
*hl-DiagnosticFloatingError*
DiagnosticFloatingError
Used to color "Error" diagnostic messages in diagnostics float.
- See |vim.diagnostic.show_line_diagnostics()|
+ See |vim.diagnostic.open_float()|
*hl-DiagnosticFloatingWarn*
DiagnosticFloatingWarn
@@ -289,11 +289,11 @@ option in the "signs" table of |vim.diagnostic.config()| or 10 if unset).
==============================================================================
EVENTS *diagnostic-events*
- *DiagnosticsChanged*
-DiagnosticsChanged After diagnostics have changed.
+ *DiagnosticChanged*
+DiagnosticChanged After diagnostics have changed.
Example: >
- autocmd User DiagnosticsChanged lua vim.diagnostic.setqflist({open = false })
+ autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({open = false })
<
==============================================================================
==============================================================================
@@ -373,39 +373,8 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
Otherwise, all signs use the same
priority.
- • float: Options for floating windows:
- • severity: See |diagnostic-severity|.
- • header: (string or table) String to use
- as the header for the floating window. If
- a table, it is interpreted as a [text,
- hl_group] tuple. Defaults to
- "Diagnostics:".
- • source: (string) Include the diagnostic
- source in the message. One of "always" or
- "if_many".
- • format: (function) A function that takes
- a diagnostic as input and returns a
- string. The return value is the text used
- to display the diagnostic.
- • prefix: (function, string, or table)
- Prefix each diagnostic in the floating
- window. If a function, it must have the
- signature (diagnostic, i, total) ->
- (string, string), where {i} is the index
- of the diagnostic being evaluated and
- {total} is the total number of
- diagnostics displayed in the window. The
- function should return a string which is
- prepended to each diagnostic in the
- window as well as an (optional) highlight
- group which will be used to highlight the
- prefix. If {prefix} is a table, it is
- interpreted as a [text, hl_group] tuple
- as in |nvim_echo()|; otherwise, if
- {prefix} is a string, it is prepended to
- each diagnostic in the window with no
- highlight.
-
+ • float: Options for floating windows. See
+ |vim.diagnostic.open_float()|.
• update_in_insert: (default false) Update
diagnostics in Insert mode (if false,
diagnostics are updated on InsertLeave)
@@ -470,7 +439,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()*
Get namespace metadata.
Parameters: ~
- {ns} number Diagnostic namespace
+ {namespace} number Diagnostic namespace
Return: ~
table Namespace metadata
@@ -539,6 +508,9 @@ goto_next({opts}) *vim.diagnostic.goto_next()*
"true", call |vim.diagnostic.open_float()| after
moving. If a table, pass the table as the {opts}
parameter to |vim.diagnostic.open_float()|.
+ Unless overridden, the float will show
+ diagnostics at the new cursor position (as if
+ "cursor" were passed to the "scope" option).
• win_id: (number, default 0) Window ID
goto_prev({opts}) *vim.diagnostic.goto_prev()*
@@ -613,7 +585,7 @@ open_float({bufnr}, {opts}) *vim.diagnostic.open_float()*
addition to the following:
• namespace: (number) Limit diagnostics to the
given namespace
- • scope: (string, default "buffer") Show
+ • scope: (string, default "line") Show
diagnostics from the whole buffer ("buffer"),
the current cursor line ("line"), or the
current cursor position ("cursor").
@@ -641,8 +613,21 @@ open_float({bufnr}, {opts}) *vim.diagnostic.open_float()*
diagnostic. Overrides the setting from
|vim.diagnostic.config()|.
• prefix: (function, string, or table) Prefix
- each diagnostic in the floating window.
- Overrides the setting from
+ each diagnostic in the floating window. If a
+ function, it must have the signature
+ (diagnostic, i, total) -> (string, string),
+ where {i} is the index of the diagnostic being
+ evaluated and {total} is the total number of
+ diagnostics displayed in the window. The
+ function should return a string which is
+ prepended to each diagnostic in the window as
+ well as an (optional) highlight group which
+ will be used to highlight the prefix. If
+ {prefix} is a table, it is interpreted as a
+ [text, hl_group] tuple as in |nvim_echo()|;
+ otherwise, if {prefix} is a string, it is
+ prepended to each diagnostic in the window with
+ no highlight. Overrides the setting from
|vim.diagnostic.config()|.
Return: ~