diff options
Diffstat (limited to 'runtime/doc/diagnostic.txt')
-rw-r--r-- | runtime/doc/diagnostic.txt | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 32936a7ee6..2446506dec 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -336,8 +336,8 @@ config({opts}, {namespace}) *vim.diagnostic.config()* that returns any of the above. Parameters: ~ - {opts} table|nil When omitted or "nil", retrieve the - current configuration. Otherwise, a + {opts} (table|nil) When omitted or "nil", retrieve + the current configuration. Otherwise, a configuration table with the following keys: • underline: (default true) Use underline for diagnostics. Options: @@ -401,7 +401,7 @@ config({opts}, {namespace}) *vim.diagnostic.config()* displayed before lower severities (e.g. ERROR is displayed before WARN). Options: • reverse: (boolean) Reverse sort order - {namespace} number|nil Update the options for the given + {namespace} (number|nil) Update the options for the given namespace. When omitted, update the global diagnostic options. @@ -409,28 +409,28 @@ disable({bufnr}, {namespace}) *vim.diagnostic.disable()* Disable diagnostics in the given buffer. Parameters: ~ - {bufnr} number|nil Buffer number, or 0 for current + {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, disable diagnostics in all buffers. - {namespace} number|nil Only disable diagnostics for the + {namespace} (number|nil) Only disable diagnostics for the given namespace. enable({bufnr}, {namespace}) *vim.diagnostic.enable()* Enable diagnostics in the given buffer. Parameters: ~ - {bufnr} number|nil Buffer number, or 0 for current + {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, enable diagnostics in all buffers. - {namespace} number|nil Only enable diagnostics for the + {namespace} (number|nil) Only enable diagnostics for the given namespace. fromqflist({list}) *vim.diagnostic.fromqflist()* Convert a list of quickfix items to a list of diagnostics. Parameters: ~ - {list} table A list of quickfix items from |getqflist()| - or |getloclist()|. + {list} (table) A list of quickfix items from + |getqflist()| or |getloclist()|. Return: ~ array of diagnostics |diagnostic-structure| @@ -439,9 +439,10 @@ get({bufnr}, {opts}) *vim.diagnostic.get()* Get current diagnostics. Parameters: ~ - {bufnr} number|nil Buffer number to get diagnostics from. - Use 0 for current buffer or nil for all buffers. - {opts} table|nil A table with the following keys: + {bufnr} (number|nil) Buffer number to get diagnostics + from. Use 0 for current buffer or nil for all + buffers. + {opts} (table|nil) A table with the following keys: • namespace: (number) Limit diagnostics to the given namespace. • lnum: (number) Limit diagnostics to the given @@ -449,67 +450,68 @@ get({bufnr}, {opts}) *vim.diagnostic.get()* • severity: See |diagnostic-severity|. Return: ~ - table A list of diagnostic items |diagnostic-structure|. + (table) A list of diagnostic items |diagnostic-structure|. get_namespace({namespace}) *vim.diagnostic.get_namespace()* Get namespace metadata. Parameters: ~ - {namespace} number Diagnostic namespace + {namespace} (number) Diagnostic namespace Return: ~ - table Namespace metadata + (table) Namespace metadata get_namespaces() *vim.diagnostic.get_namespaces()* Get current diagnostic namespaces. Return: ~ - table A list of active diagnostic namespaces + (table) A list of active diagnostic namespaces |vim.diagnostic|. get_next({opts}) *vim.diagnostic.get_next()* Get the next diagnostic closest to the cursor position. Parameters: ~ - {opts} table See |vim.diagnostic.goto_next()| + {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ - table Next diagnostic + (table) Next diagnostic get_next_pos({opts}) *vim.diagnostic.get_next_pos()* Return the position of the next diagnostic in the current buffer. Parameters: ~ - {opts} table See |vim.diagnostic.goto_next()| + {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ - table Next diagnostic position as a (row, col) tuple. + (table) Next diagnostic position as a (row, col) tuple. get_prev({opts}) *vim.diagnostic.get_prev()* Get the previous diagnostic closest to the cursor position. Parameters: ~ - {opts} table See |vim.diagnostic.goto_next()| + {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ - table Previous diagnostic + (table) Previous diagnostic get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()* Return the position of the previous diagnostic in the current buffer. Parameters: ~ - {opts} table See |vim.diagnostic.goto_next()| + {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ - table Previous diagnostic position as a (row, col) tuple. + (table) Previous diagnostic position as a (row, col) + tuple. goto_next({opts}) *vim.diagnostic.goto_next()* Move to the next diagnostic. Parameters: ~ - {opts} table|nil Configuration table with the following + {opts} (table|nil) Configuration table with the following keys: • namespace: (number) Only consider diagnostics from the given namespace. @@ -533,7 +535,7 @@ goto_prev({opts}) *vim.diagnostic.goto_prev()* Move to the previous diagnostic in the current buffer. Parameters: ~ - {opts} table See |vim.diagnostic.goto_next()| + {opts} (table) See |vim.diagnostic.goto_next()| hide({namespace}, {bufnr}) *vim.diagnostic.hide()* Hide currently displayed diagnostics. @@ -547,10 +549,10 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()* |vim.diagnostic.disable()|. Parameters: ~ - {namespace} number|nil Diagnostic namespace. When + {namespace} (number|nil) Diagnostic namespace. When omitted, hide diagnostics from all namespaces. - {bufnr} number|nil Buffer number, or 0 for current + {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, hide diagnostics in all buffers. @@ -573,16 +575,16 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults}) < Parameters: ~ - {str} string String to parse diagnostics from. - {pat} string Lua pattern with capture groups. - {groups} table List of fields in a + {str} (string) String to parse diagnostics from. + {pat} (string) Lua pattern with capture groups. + {groups} (table) List of fields in a |diagnostic-structure| to associate with captures from {pat}. - {severity_map} table A table mapping the severity field + {severity_map} (table) A table mapping the severity field from {groups} with an item from |vim.diagnostic.severity|. - {defaults} table|nil Table of default values for any - fields not listed in {groups}. When + {defaults} (table|nil) Table of default values for + any fields not listed in {groups}. When omitted, numeric values default to 0 and "severity" defaults to ERROR. @@ -594,7 +596,7 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()* Show diagnostics in a floating window. Parameters: ~ - {opts} table|nil Configuration table with the same keys + {opts} (table|nil) Configuration table with the same keys as |vim.lsp.util.open_floating_preview()| in addition to the following: • bufnr: (number) Buffer number to show @@ -665,10 +667,10 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()* |vim.diagnostic.hide()|. Parameters: ~ - {namespace} number|nil Diagnostic namespace. When + {namespace} (number|nil) Diagnostic namespace. When omitted, remove diagnostics from all namespaces. - {bufnr} number|nil Remove diagnostics for the given + {bufnr} (number|nil) Remove diagnostics for the given buffer. When omitted, diagnostics are removed for all buffers. @@ -676,18 +678,18 @@ set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()* Set diagnostics for the given namespace and buffer. Parameters: ~ - {namespace} number The diagnostic namespace - {bufnr} number Buffer number - {diagnostics} table A list of diagnostic items + {namespace} (number) The diagnostic namespace + {bufnr} (number) Buffer number + {diagnostics} (table) A list of diagnostic items |diagnostic-structure| - {opts} table|nil Display options to pass to + {opts} (table|nil) Display options to pass to |vim.diagnostic.show()| setloclist({opts}) *vim.diagnostic.setloclist()* Add buffer diagnostics to the location list. Parameters: ~ - {opts} table|nil Configuration table with the following + {opts} (table|nil) Configuration table with the following keys: • namespace: (number) Only add diagnostics from the given namespace. @@ -703,7 +705,7 @@ setqflist({opts}) *vim.diagnostic.setqflist()* Add all diagnostics to the quickfix list. Parameters: ~ - {opts} table|nil Configuration table with the following + {opts} (table|nil) Configuration table with the following keys: • namespace: (number) Only add diagnostics from the given namespace. @@ -718,20 +720,20 @@ show({namespace}, {bufnr}, {diagnostics}, {opts}) Display diagnostics for the given namespace and buffer. Parameters: ~ - {namespace} number|nil Diagnostic namespace. When + {namespace} (number|nil) Diagnostic namespace. When omitted, show diagnostics from all namespaces. - {bufnr} number|nil Buffer number, or 0 for current - buffer. When omitted, show diagnostics in - all buffers. - {diagnostics} table|nil The diagnostics to display. When - omitted, use the saved diagnostics for the - given namespace and buffer. This can be + {bufnr} (number|nil) Buffer number, or 0 for + current buffer. When omitted, show + diagnostics in all buffers. + {diagnostics} (table|nil) The diagnostics to display. + When omitted, use the saved diagnostics for + the given namespace and buffer. This can be used to display a list of diagnostics without saving them or to display only a subset of diagnostics. May not be used when {namespace} or {bufnr} is nil. - {opts} table|nil Display options. See + {opts} (table|nil) Display options. See |vim.diagnostic.config()|. toqflist({diagnostics}) *vim.diagnostic.toqflist()* @@ -739,7 +741,7 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()* can be passed to |setqflist()| or |setloclist()|. Parameters: ~ - {diagnostics} table List of diagnostics + {diagnostics} (table) List of diagnostics |diagnostic-structure|. Return: ~ |