mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(diagnostic): typing
This commit is contained in:
parent
91ba9d0bf4
commit
50284d07b6
@ -523,7 +523,7 @@ fromqflist({list}) *vim.diagnostic.fromqflist()*
|
|||||||
|getloclist()|.
|
|getloclist()|.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`Diagnostic[]`) array of |diagnostic-structure|
|
(`vim.Diagnostic[]`) array of |diagnostic-structure|
|
||||||
|
|
||||||
get({bufnr}, {opts}) *vim.diagnostic.get()*
|
get({bufnr}, {opts}) *vim.diagnostic.get()*
|
||||||
Get current diagnostics.
|
Get current diagnostics.
|
||||||
@ -541,7 +541,7 @@ get({bufnr}, {opts}) *vim.diagnostic.get()*
|
|||||||
• severity: See |diagnostic-severity|.
|
• severity: See |diagnostic-severity|.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`Diagnostic[]`) table A list of diagnostic items
|
(`vim.Diagnostic[]`) table A list of diagnostic items
|
||||||
|diagnostic-structure|. Keys `bufnr` , `end_lnum` , `end_col` , and `severity` are
|
|diagnostic-structure|. Keys `bufnr` , `end_lnum` , `end_col` , and `severity` are
|
||||||
guaranteed to be present.
|
guaranteed to be present.
|
||||||
|
|
||||||
@ -558,7 +558,8 @@ get_namespaces() *vim.diagnostic.get_namespaces()*
|
|||||||
Get current diagnostic namespaces.
|
Get current diagnostic namespaces.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`table`) A list of active diagnostic namespaces |vim.diagnostic|.
|
(`table<integer,vim.diagnostic.NS>`) A list of active diagnostic
|
||||||
|
namespaces |vim.diagnostic|.
|
||||||
|
|
||||||
get_next({opts}) *vim.diagnostic.get_next()*
|
get_next({opts}) *vim.diagnostic.get_next()*
|
||||||
Get the next diagnostic closest to the cursor position.
|
Get the next diagnostic closest to the cursor position.
|
||||||
@ -567,7 +568,7 @@ get_next({opts}) *vim.diagnostic.get_next()*
|
|||||||
• {opts} (`table?`) See |vim.diagnostic.goto_next()|
|
• {opts} (`table?`) See |vim.diagnostic.goto_next()|
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`Diagnostic?`) Next diagnostic
|
(`vim.Diagnostic?`) Next diagnostic
|
||||||
|
|
||||||
get_next_pos({opts}) *vim.diagnostic.get_next_pos()*
|
get_next_pos({opts}) *vim.diagnostic.get_next_pos()*
|
||||||
Return the position of the next diagnostic in the current buffer.
|
Return the position of the next diagnostic in the current buffer.
|
||||||
@ -586,7 +587,7 @@ get_prev({opts}) *vim.diagnostic.get_prev()*
|
|||||||
• {opts} (`table?`) See |vim.diagnostic.goto_next()|
|
• {opts} (`table?`) See |vim.diagnostic.goto_next()|
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`Diagnostic?`) Previous diagnostic
|
(`vim.Diagnostic?`) Previous diagnostic
|
||||||
|
|
||||||
get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
|
get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
|
||||||
Return the position of the previous diagnostic in the current buffer.
|
Return the position of the previous diagnostic in the current buffer.
|
||||||
@ -603,8 +604,8 @@ goto_next({opts}) *vim.diagnostic.goto_next()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {opts} (`table?`) Configuration table with the following keys:
|
• {opts} (`table?`) Configuration table with the following keys:
|
||||||
• namespace: (number) Only consider diagnostics from the given
|
• namespace: (integer) Only consider diagnostics from the
|
||||||
namespace.
|
given namespace.
|
||||||
• cursor_position: (cursor position) Cursor position as a
|
• cursor_position: (cursor position) Cursor position as a
|
||||||
(row, col) tuple. See |nvim_win_get_cursor()|. Defaults to
|
(row, col) tuple. See |nvim_win_get_cursor()|. Defaults to
|
||||||
the current cursor position.
|
the current cursor position.
|
||||||
@ -646,9 +647,9 @@ is_disabled({bufnr}, {namespace}) *vim.diagnostic.is_disabled()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {bufnr} (`integer?`) Buffer number, or 0 for current buffer.
|
• {bufnr} (`integer?`) Buffer number, or 0 for current buffer.
|
||||||
• {namespace} (`integer?`) Diagnostic namespace. When omitted, checks if
|
• {namespace} (`integer?`) Diagnostic namespace. When omitted, checks
|
||||||
all diagnostics are disabled in {bufnr}. Otherwise, only
|
if all diagnostics are disabled in {bufnr}. Otherwise,
|
||||||
checks if diagnostics from {namespace} are disabled.
|
only checks if diagnostics from {namespace} are disabled.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`boolean`)
|
(`boolean`)
|
||||||
@ -671,8 +672,9 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
|
|||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {str} (`string`) String to parse diagnostics from.
|
• {str} (`string`) String to parse diagnostics from.
|
||||||
• {pat} (`string`) Lua pattern with capture groups.
|
• {pat} (`string`) Lua pattern with capture groups.
|
||||||
• {groups} (`table`) List of fields in a |diagnostic-structure|
|
• {groups} (`string[]`) List of fields in a
|
||||||
to associate with captures from {pat}.
|
|diagnostic-structure| to associate with captures from
|
||||||
|
{pat}.
|
||||||
• {severity_map} (`table`) A table mapping the severity field from
|
• {severity_map} (`table`) A table mapping the severity field from
|
||||||
{groups} with an item from |vim.diagnostic.severity|.
|
{groups} with an item from |vim.diagnostic.severity|.
|
||||||
• {defaults} (`table?`) Table of default values for any fields not
|
• {defaults} (`table?`) Table of default values for any fields not
|
||||||
@ -680,8 +682,8 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
|
|||||||
default to 0 and "severity" defaults to ERROR.
|
default to 0 and "severity" defaults to ERROR.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`Diagnostic?`) |diagnostic-structure| or `nil` if {pat} fails to match
|
(`vim.Diagnostic?`) |diagnostic-structure| or `nil` if {pat} fails to
|
||||||
{str}.
|
match {str}.
|
||||||
|
|
||||||
open_float({opts}, {...}) *vim.diagnostic.open_float()*
|
open_float({opts}, {...}) *vim.diagnostic.open_float()*
|
||||||
Show diagnostics in a floating window.
|
Show diagnostics in a floating window.
|
||||||
@ -740,14 +742,14 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()*
|
|||||||
(`integer?, integer?`) ({float_bufnr}, {win_id})
|
(`integer?, integer?`) ({float_bufnr}, {win_id})
|
||||||
|
|
||||||
reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
|
reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
|
||||||
Remove all diagnostics from the given namespace.
|
|
||||||
|
|
||||||
Unlike |vim.diagnostic.hide()|, this function removes all saved
|
Unlike |vim.diagnostic.hide()|, this function removes all saved
|
||||||
diagnostics. They cannot be redisplayed using |vim.diagnostic.show()|. To
|
diagnostics. They cannot be redisplayed using |vim.diagnostic.show()|. To
|
||||||
simply remove diagnostic decorations in a way that they can be
|
simply remove diagnostic decorations in a way that they can be
|
||||||
re-displayed, use |vim.diagnostic.hide()|.
|
re-displayed, use |vim.diagnostic.hide()|.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
|
• {d} (`vim.Diagnostic`) Remove all diagnostics from the given
|
||||||
|
namespace.
|
||||||
• {namespace} (`integer?`) Diagnostic namespace. When omitted, remove
|
• {namespace} (`integer?`) Diagnostic namespace. When omitted, remove
|
||||||
diagnostics from all namespaces.
|
diagnostics from all namespaces.
|
||||||
• {bufnr} (`integer?`) Remove diagnostics for the given buffer.
|
• {bufnr} (`integer?`) Remove diagnostics for the given buffer.
|
||||||
@ -759,7 +761,7 @@ set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()*
|
|||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {namespace} (`integer`) The diagnostic namespace
|
• {namespace} (`integer`) The diagnostic namespace
|
||||||
• {bufnr} (`integer`) Buffer number
|
• {bufnr} (`integer`) Buffer number
|
||||||
• {diagnostics} (`table`) A list of diagnostic items
|
• {diagnostics} (`vim.Diagnostic[]`) A list of diagnostic items
|
||||||
|diagnostic-structure|
|
|diagnostic-structure|
|
||||||
• {opts} (`table?`) Display options to pass to
|
• {opts} (`table?`) Display options to pass to
|
||||||
|vim.diagnostic.show()|
|
|vim.diagnostic.show()|
|
||||||
@ -801,12 +803,12 @@ show({namespace}, {bufnr}, {diagnostics}, {opts})
|
|||||||
diagnostics from all namespaces.
|
diagnostics from all namespaces.
|
||||||
• {bufnr} (`integer?`) Buffer number, or 0 for current buffer.
|
• {bufnr} (`integer?`) Buffer number, or 0 for current buffer.
|
||||||
When omitted, show diagnostics in all buffers.
|
When omitted, show diagnostics in all buffers.
|
||||||
• {diagnostics} (`table?`) The diagnostics to display. When omitted,
|
• {diagnostics} (`vim.Diagnostic[]?`) The diagnostics to display. When
|
||||||
use the saved diagnostics for the given namespace and
|
omitted, use the saved diagnostics for the given
|
||||||
buffer. This can be used to display a list of
|
namespace and buffer. This can be used to display a
|
||||||
diagnostics without saving them or to display only a
|
list of diagnostics without saving them or to display
|
||||||
subset of diagnostics. May not be used when {namespace}
|
only a subset of diagnostics. May not be used when
|
||||||
or {bufnr} is nil.
|
{namespace} or {bufnr} is nil.
|
||||||
• {opts} (`table?`) Display options. See
|
• {opts} (`table?`) Display options. See
|
||||||
|vim.diagnostic.config()|.
|
|vim.diagnostic.config()|.
|
||||||
|
|
||||||
@ -815,7 +817,8 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()*
|
|||||||
passed to |setqflist()| or |setloclist()|.
|
passed to |setqflist()| or |setloclist()|.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {diagnostics} (`table`) List of diagnostics |diagnostic-structure|.
|
• {diagnostics} (`vim.Diagnostic[]`) List of diagnostics
|
||||||
|
|diagnostic-structure|.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`table[]`) of quickfix list items |setqflist-what|
|
(`table[]`) of quickfix list items |setqflist-what|
|
||||||
|
@ -14,8 +14,9 @@ local F = {}
|
|||||||
--- assert(vim.F.if_nil(a, b, c, d) == 42)
|
--- assert(vim.F.if_nil(a, b, c, d) == 42)
|
||||||
--- ```
|
--- ```
|
||||||
---
|
---
|
||||||
---@param ... any
|
---@generic T
|
||||||
---@return any
|
---@param ... T
|
||||||
|
---@return T
|
||||||
function F.if_nil(...)
|
function F.if_nil(...)
|
||||||
local nargs = select('#', ...)
|
local nargs = select('#', ...)
|
||||||
for i = 1, nargs do
|
for i = 1, nargs do
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -291,9 +291,11 @@ function Lua2DoxFilter:process_magic(line)
|
|||||||
for _, type in ipairs(TYPES) do
|
for _, type in ipairs(TYPES) do
|
||||||
line = line:gsub('^@param%s+([a-zA-Z_?]+)%s+.*%((' .. type .. ')%)', '@param %1 %2')
|
line = line:gsub('^@param%s+([a-zA-Z_?]+)%s+.*%((' .. type .. ')%)', '@param %1 %2')
|
||||||
line = line:gsub('^@param%s+([a-zA-Z_?]+)%s+.*%((' .. type .. '|nil)%)', '@param %1 %2')
|
line = line:gsub('^@param%s+([a-zA-Z_?]+)%s+.*%((' .. type .. '|nil)%)', '@param %1 %2')
|
||||||
|
line = line:gsub('^@param%s+([a-zA-Z_?]+)%s+.*%((' .. type .. '%?)%)', '@param %1 %2')
|
||||||
|
|
||||||
line = line:gsub('^@return%s+.*%((' .. type .. ')%)', '@return %1')
|
line = line:gsub('^@return%s+.*%((' .. type .. ')%)', '@return %1')
|
||||||
line = line:gsub('^@return%s+.*%((' .. type .. '|nil)%)', '@return %1')
|
line = line:gsub('^@return%s+.*%((' .. type .. '|nil)%)', '@return %1')
|
||||||
|
line = line:gsub('^@return%s+.*%((' .. type .. '%?)%)', '@return %1')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user