mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
docs(diagnostic): number → integer (#22512)
This commit is contained in:
@@ -630,7 +630,7 @@ end
|
||||
--- Options:
|
||||
--- * reverse: (boolean) Reverse sort order
|
||||
---
|
||||
---@param namespace number|nil Update the options for the given namespace. When omitted, update the
|
||||
---@param namespace integer|nil Update the options for the given namespace. When omitted, update the
|
||||
--- global diagnostic options.
|
||||
function M.config(opts, namespace)
|
||||
vim.validate({
|
||||
@@ -674,8 +674,8 @@ end
|
||||
|
||||
--- Set diagnostics for the given namespace and buffer.
|
||||
---
|
||||
---@param namespace number The diagnostic namespace
|
||||
---@param bufnr number Buffer number
|
||||
---@param namespace integer The diagnostic namespace
|
||||
---@param bufnr integer Buffer number
|
||||
---@param diagnostics table A list of diagnostic items |diagnostic-structure|
|
||||
---@param opts table|nil Display options to pass to |vim.diagnostic.show()|
|
||||
function M.set(namespace, bufnr, diagnostics, opts)
|
||||
@@ -711,7 +711,7 @@ end
|
||||
|
||||
--- Get namespace metadata.
|
||||
---
|
||||
---@param namespace number Diagnostic namespace
|
||||
---@param namespace integer Diagnostic namespace
|
||||
---@return table Namespace metadata
|
||||
function M.get_namespace(namespace)
|
||||
vim.validate({ namespace = { namespace, 'n' } })
|
||||
@@ -743,11 +743,11 @@ function M.get_namespaces()
|
||||
end
|
||||
|
||||
---@class Diagnostic
|
||||
---@field buffer number
|
||||
---@field lnum number 0-indexed
|
||||
---@field end_lnum nil|number 0-indexed
|
||||
---@field col number 0-indexed
|
||||
---@field end_col nil|number 0-indexed
|
||||
---@field buffer integer
|
||||
---@field lnum integer 0-indexed
|
||||
---@field end_lnum nil|integer 0-indexed
|
||||
---@field col integer 0-indexed
|
||||
---@field end_col nil|integer 0-indexed
|
||||
---@field severity DiagnosticSeverity
|
||||
---@field message string
|
||||
---@field source nil|string
|
||||
@@ -756,7 +756,7 @@ end
|
||||
|
||||
--- Get current diagnostics.
|
||||
---
|
||||
---@param bufnr number|nil Buffer number to get diagnostics from. Use 0 for
|
||||
---@param bufnr integer|nil Buffer number to get diagnostics from. Use 0 for
|
||||
--- current buffer or nil for all buffers.
|
||||
---@param opts table|nil A table with the following keys:
|
||||
--- - namespace: (number) Limit diagnostics to the given namespace.
|
||||
@@ -1083,9 +1083,9 @@ end
|
||||
--- To hide diagnostics and prevent them from re-displaying, use
|
||||
--- |vim.diagnostic.disable()|.
|
||||
---
|
||||
---@param namespace number|nil Diagnostic namespace. When omitted, hide
|
||||
---@param namespace integer|nil Diagnostic namespace. When omitted, hide
|
||||
--- diagnostics from all namespaces.
|
||||
---@param bufnr number|nil Buffer number, or 0 for current buffer. When
|
||||
---@param bufnr integer|nil Buffer number, or 0 for current buffer. When
|
||||
--- omitted, hide diagnostics in all buffers.
|
||||
function M.hide(namespace, bufnr)
|
||||
vim.validate({
|
||||
@@ -1108,8 +1108,8 @@ end
|
||||
|
||||
--- Check whether diagnostics are disabled in a given buffer.
|
||||
---
|
||||
---@param bufnr number|nil Buffer number, or 0 for current buffer.
|
||||
---@param namespace number|nil Diagnostic namespace. When omitted, checks if
|
||||
---@param bufnr integer|nil Buffer number, or 0 for current buffer.
|
||||
---@param namespace integer|nil Diagnostic namespace. When omitted, checks if
|
||||
--- all diagnostics are disabled in {bufnr}.
|
||||
--- Otherwise, only checks if diagnostics from
|
||||
--- {namespace} are disabled.
|
||||
@@ -1129,9 +1129,9 @@ end
|
||||
|
||||
--- Display diagnostics for the given namespace and buffer.
|
||||
---
|
||||
---@param namespace number|nil Diagnostic namespace. When omitted, show
|
||||
---@param namespace integer|nil Diagnostic namespace. When omitted, show
|
||||
--- diagnostics from all namespaces.
|
||||
---@param bufnr number|nil Buffer number, or 0 for current buffer. When omitted, show
|
||||
---@param bufnr integer|nil Buffer number, or 0 for current buffer. When omitted, show
|
||||
--- diagnostics in all buffers.
|
||||
---@param diagnostics table|nil The diagnostics to display. When omitted, use the
|
||||
--- saved diagnostics for the given namespace and
|
||||
@@ -1256,7 +1256,7 @@ end
|
||||
--- Overrides the setting from |vim.diagnostic.config()|.
|
||||
--- - suffix: Same as {prefix}, but appends the text to the diagnostic instead of
|
||||
--- prepending it. Overrides the setting from |vim.diagnostic.config()|.
|
||||
---@return number|nil, number|nil: ({float_bufnr}, {win_id})
|
||||
---@return integer|nil, integer|nil: ({float_bufnr}, {win_id})
|
||||
function M.open_float(opts, ...)
|
||||
-- Support old (bufnr, opts) signature
|
||||
local bufnr
|
||||
@@ -1463,9 +1463,9 @@ end
|
||||
--- simply remove diagnostic decorations in a way that they can be
|
||||
--- re-displayed, use |vim.diagnostic.hide()|.
|
||||
---
|
||||
---@param namespace number|nil Diagnostic namespace. When omitted, remove
|
||||
---@param namespace integer|nil Diagnostic namespace. When omitted, remove
|
||||
--- diagnostics from all namespaces.
|
||||
---@param bufnr number|nil Remove diagnostics for the given buffer. When omitted,
|
||||
---@param bufnr integer|nil Remove diagnostics for the given buffer. When omitted,
|
||||
--- diagnostics are removed for all buffers.
|
||||
function M.reset(namespace, bufnr)
|
||||
vim.validate({
|
||||
@@ -1518,9 +1518,9 @@ end
|
||||
|
||||
--- Disable diagnostics in the given buffer.
|
||||
---
|
||||
---@param bufnr number|nil Buffer number, or 0 for current buffer. When
|
||||
---@param bufnr integer|nil Buffer number, or 0 for current buffer. When
|
||||
--- omitted, disable diagnostics in all buffers.
|
||||
---@param namespace number|nil Only disable diagnostics for the given namespace.
|
||||
---@param namespace integer|nil Only disable diagnostics for the given namespace.
|
||||
function M.disable(bufnr, namespace)
|
||||
vim.validate({ bufnr = { bufnr, 'n', true }, namespace = { namespace, 'n', true } })
|
||||
if bufnr == nil then
|
||||
@@ -1555,9 +1555,9 @@ end
|
||||
|
||||
--- Enable diagnostics in the given buffer.
|
||||
---
|
||||
---@param bufnr number|nil Buffer number, or 0 for current buffer. When
|
||||
---@param bufnr integer|nil Buffer number, or 0 for current buffer. When
|
||||
--- omitted, enable diagnostics in all buffers.
|
||||
---@param namespace number|nil Only enable diagnostics for the given namespace.
|
||||
---@param namespace integer|nil Only enable diagnostics for the given namespace.
|
||||
function M.enable(bufnr, namespace)
|
||||
vim.validate({ bufnr = { bufnr, 'n', true }, namespace = { namespace, 'n', true } })
|
||||
if bufnr == nil then
|
||||
|
||||
Reference in New Issue
Block a user