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.txt133
1 files changed, 68 insertions, 65 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 36616b9a0d..342947595e 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -363,7 +363,6 @@ Lua module: vim.diagnostic *diagnostic-api*
• {message} (`string`) The diagnostic text
• {source}? (`string`) The source of the diagnostic
• {code}? (`string|integer`) The diagnostic code
- • {_tags}? (`{ deprecated: boolean, unnecessary: boolean}`)
• {user_data}? (`any`) arbitrary data plugins can add
• {namespace}? (`integer`)
@@ -378,28 +377,38 @@ Lua module: vim.diagnostic *diagnostic-api*
• {severity}? (`vim.diagnostic.SeverityFilter`) See
|diagnostic-severity|.
-*vim.diagnostic.GotoOpts*
+*vim.diagnostic.JumpOpts*
Extends: |vim.diagnostic.GetOpts|
- Configuration table with the following keys:
+ Configuration table with the keys listed below. Some parameters can have
+ their default values changed with |vim.diagnostic.config()|.
Fields: ~
- • {cursor_position}? (`{[1]:integer,[2]:integer}`, default: current cursor position)
- Cursor position as a `(row, col)` tuple. See
- |nvim_win_get_cursor()|.
- • {wrap}? (`boolean`, default: `true`) Whether to loop
- around file or not. Similar to 'wrapscan'.
- • {severity}? (`vim.diagnostic.SeverityFilter`) See
- |diagnostic-severity|.
- • {float}? (`boolean|vim.diagnostic.Opts.Float`, default:
- `true`) If `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}? (`integer`, default: `0`) Window ID
+ • {diagnostic}? (`vim.Diagnostic`) The diagnostic to jump to. Mutually
+ exclusive with {count}, {namespace}, and {severity}.
+ See |vim.Diagnostic|.
+ • {count}? (`integer`) The number of diagnostics to move by,
+ starting from {pos}. A positive integer moves forward
+ by {count} diagnostics, while a negative integer moves
+ backward by {count} diagnostics. Mutually exclusive
+ with {diagnostic}.
+ • {pos}? (`[integer,integer]`) Cursor position as a `(row, col)`
+ tuple. See |nvim_win_get_cursor()|. Used to find the
+ nearest diagnostic when {count} is used. Only used when
+ {count} is non-nil. Default is the current cursor
+ position.
+ • {wrap}? (`boolean`, default: `true`) Whether to loop around
+ file or not. Similar to 'wrapscan'.
+ • {severity}? (`vim.diagnostic.SeverityFilter`) See
+ |diagnostic-severity|.
+ • {float}? (`boolean|vim.diagnostic.Opts.Float`, default: `false`)
+ If `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).
+ • {winid}? (`integer`, default: `0`) Window ID
*vim.diagnostic.NS*
@@ -410,7 +419,7 @@ Lua module: vim.diagnostic *diagnostic-api*
• {disabled}? (`boolean`)
*vim.diagnostic.Opts*
- Each of the configuration options below accepts one of the following:
+ Many of the configuration options below accept one of the following:
• `false`: Disable this feature
• `true`: Enable this feature, use default settings.
• `table`: Enable this feature with overrides. Use an empty table to use
@@ -441,6 +450,9 @@ Lua module: vim.diagnostic *diagnostic-api*
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*
@@ -454,18 +466,18 @@ Lua module: vim.diagnostic *diagnostic-api*
current cursor position (`cursor`). Shorthand
versions are also accepted (`c` for `cursor`, `l`
for `line`, `b` for `buffer`).
- • {pos}? (`integer|{[1]:integer,[2]: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.
+ • {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|{[1]:string,[2]:any}`) String to use as the
- header for the floating window. If a table, it is
+ • {header}? (`string|[string,any]`) String to use as the header
+ for the floating window. If a table, it is
interpreted as a `[text, hl_group]` tuple. Overrides
the setting from |vim.diagnostic.config()|.
• {source}? (`boolean|'if_many'`) Include the diagnostic source
@@ -500,6 +512,17 @@ Lua module: vim.diagnostic *diagnostic-api*
• {focus_id}? (`string`)
• {border}? (`string`) see |nvim_open_win()|.
+*vim.diagnostic.Opts.Jump*
+
+ Fields: ~
+ • {float}? (`boolean|vim.diagnostic.Opts.Float`, default: false)
+ Default value of the {float} parameter of
+ |vim.diagnostic.jump()|.
+ • {wrap}? (`boolean`, default: true) Default value of the {wrap}
+ parameter of |vim.diagnostic.jump()|.
+ • {severity}? (`vim.diagnostic.SeverityFilter`) Default value of the
+ {severity} parameter of |vim.diagnostic.jump()|.
+
*vim.diagnostic.Opts.Signs*
Fields: ~
@@ -568,8 +591,7 @@ Lua module: vim.diagnostic *diagnostic-api*
<
• {hl_mode}? (`'replace'|'combine'|'blend'`) See
|nvim_buf_set_extmark()|.
- • {virt_text}? (`{[1]:string,[2]:any}[]`) See
- |nvim_buf_set_extmark()|.
+ • {virt_text}? (`[string,any][]`) See |nvim_buf_set_extmark()|.
• {virt_text_pos}? (`'eol'|'overlay'|'right_align'|'inline'`) See
|nvim_buf_set_extmark()|.
• {virt_text_win_col}? (`integer`) See |nvim_buf_set_extmark()|.
@@ -678,52 +700,20 @@ get_next({opts}) *vim.diagnostic.get_next()*
Get the next diagnostic closest to the cursor position.
Parameters: ~
- • {opts} (`vim.diagnostic.GotoOpts?`) See |vim.diagnostic.GotoOpts|.
+ • {opts} (`vim.diagnostic.JumpOpts?`) See |vim.diagnostic.JumpOpts|.
Return: ~
(`vim.Diagnostic?`) Next diagnostic. See |vim.Diagnostic|.
-get_next_pos({opts}) *vim.diagnostic.get_next_pos()*
- Return the position of the next diagnostic in the current buffer.
-
- Parameters: ~
- • {opts} (`vim.diagnostic.GotoOpts?`) See |vim.diagnostic.GotoOpts|.
-
- Return: ~
- (`table|false`) Next diagnostic position as a `(row, col)` tuple or
- false if no next diagnostic.
-
get_prev({opts}) *vim.diagnostic.get_prev()*
Get the previous diagnostic closest to the cursor position.
Parameters: ~
- • {opts} (`vim.diagnostic.GotoOpts?`) See |vim.diagnostic.GotoOpts|.
+ • {opts} (`vim.diagnostic.JumpOpts?`) See |vim.diagnostic.JumpOpts|.
Return: ~
(`vim.Diagnostic?`) Previous diagnostic. See |vim.Diagnostic|.
-get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
- Return the position of the previous diagnostic in the current buffer.
-
- Parameters: ~
- • {opts} (`vim.diagnostic.GotoOpts?`) See |vim.diagnostic.GotoOpts|.
-
- Return: ~
- (`table|false`) Previous diagnostic position as a `(row, col)` tuple
- or `false` if there is no prior diagnostic.
-
-goto_next({opts}) *vim.diagnostic.goto_next()*
- Move to the next diagnostic.
-
- Parameters: ~
- • {opts} (`vim.diagnostic.GotoOpts?`) See |vim.diagnostic.GotoOpts|.
-
-goto_prev({opts}) *vim.diagnostic.goto_prev()*
- Move to the previous diagnostic in the current buffer.
-
- Parameters: ~
- • {opts} (`vim.diagnostic.GotoOpts?`) See |vim.diagnostic.GotoOpts|.
-
hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
Hide currently displayed diagnostics.
@@ -743,6 +733,9 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
is_enabled({filter}) *vim.diagnostic.is_enabled()*
Check whether diagnostics are enabled.
+ Attributes: ~
+ Since: 0.10.0
+
Parameters: ~
• {filter} (`table?`) Optional filters |kwargs|, or `nil` for all.
• {ns_id}? (`integer`) Diagnostic namespace, or `nil` for
@@ -753,6 +746,16 @@ is_enabled({filter}) *vim.diagnostic.is_enabled()*
Return: ~
(`boolean`)
+jump({opts}) *vim.diagnostic.jump()*
+ Move to a diagnostic.
+
+ Parameters: ~
+ • {opts} (`vim.diagnostic.JumpOpts`) See |vim.diagnostic.JumpOpts|.
+
+ Return: ~
+ (`vim.Diagnostic?`) The diagnostic that was moved to. See
+ |vim.Diagnostic|.
+
*vim.diagnostic.match()*
match({str}, {pat}, {groups}, {severity_map}, {defaults})
Parse a diagnostic from a string.
@@ -792,7 +795,7 @@ open_float({opts}) *vim.diagnostic.open_float()*
Return (multiple): ~
(`integer?`) float_bufnr
- (`integer?`) win_id
+ (`integer?`) winid
reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
Remove all diagnostics from the given namespace.
@@ -831,7 +834,7 @@ setloclist({opts}) *vim.diagnostic.setloclist()*
after setting.
• {title}? (`string`) Title of the location list. Defaults to
"Diagnostics".
- • {severity}? (`vim.diagnostic.Severity`) See
+ • {severity}? (`vim.diagnostic.SeverityFilter`) See
|diagnostic-severity|.
setqflist({opts}) *vim.diagnostic.setqflist()*
@@ -845,7 +848,7 @@ setqflist({opts}) *vim.diagnostic.setqflist()*
after setting.
• {title}? (`string`) Title of quickfix list. Defaults to
"Diagnostics".
- • {severity}? (`vim.diagnostic.Severity`) See
+ • {severity}? (`vim.diagnostic.SeverityFilter`) See
|diagnostic-severity|.
*vim.diagnostic.show()*