diff options
author | Jaehwang Jung <tomtomjhj@gmail.com> | 2023-03-04 22:06:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-04 13:06:20 +0000 |
commit | 82b77900d7f85088c676be886937628230d0d5c2 (patch) | |
tree | f6439f3cb512f04531b0d47edf8ae07ce17d3bc0 | |
parent | 65e2feabeb9bd17a076206d98dadb93515e9b612 (diff) | |
download | rneovim-82b77900d7f85088c676be886937628230d0d5c2.tar.gz rneovim-82b77900d7f85088c676be886937628230d0d5c2.tar.bz2 rneovim-82b77900d7f85088c676be886937628230d0d5c2.zip |
docs(diagnostic): number → integer (#22512)
-rw-r--r-- | runtime/doc/diagnostic.txt | 44 | ||||
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 46 |
2 files changed, 45 insertions, 45 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index c661bf02bf..cff73ad097 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -423,25 +423,25 @@ config({opts}, {namespace}) *vim.diagnostic.config()* severities are 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. + • {namespace} (integer|nil) Update the options for the given namespace. When omitted, update the global diagnostic options. disable({bufnr}, {namespace}) *vim.diagnostic.disable()* Disable diagnostics in the given buffer. Parameters: ~ - • {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 given + • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. + When omitted, disable diagnostics in all buffers. + • {namespace} (integer|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 buffer. When - omitted, enable diagnostics in all buffers. - • {namespace} (number|nil) Only enable diagnostics for the given + • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. + When omitted, enable diagnostics in all buffers. + • {namespace} (integer|nil) Only enable diagnostics for the given namespace. fromqflist({list}) *vim.diagnostic.fromqflist()* @@ -458,8 +458,8 @@ 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. + • {bufnr} (integer|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. @@ -473,7 +473,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()* Get namespace metadata. Parameters: ~ - • {namespace} (number) Diagnostic namespace + • {namespace} (integer) Diagnostic namespace Return: ~ (table) Namespace metadata @@ -560,17 +560,17 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()* |vim.diagnostic.disable()|. Parameters: ~ - • {namespace} (number|nil) Diagnostic namespace. When omitted, hide diagnostics from all + • {namespace} (integer|nil) Diagnostic namespace. When omitted, hide diagnostics from all namespaces. - • {bufnr} (number|nil) Buffer number, or 0 for current buffer. When - omitted, hide diagnostics in all buffers. + • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. + When omitted, hide diagnostics in all buffers. is_disabled({bufnr}, {namespace}) *vim.diagnostic.is_disabled()* Check whether diagnostics are disabled in a given buffer. Parameters: ~ - • {bufnr} (number|nil) Buffer number, or 0 for current buffer. - • {namespace} (number|nil) Diagnostic namespace. When omitted, checks if all diagnostics are + • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. + • {namespace} (integer|nil) Diagnostic namespace. When omitted, checks if all diagnostics are disabled in {bufnr}. Otherwise, only checks if diagnostics from {namespace} are disabled. @@ -663,7 +663,7 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()* from |vim.diagnostic.config()|. Return: ~ - number|nil, number|nil: ({float_bufnr}, {win_id}) + integer|nil, integer|nil: ({float_bufnr}, {win_id}) reset({namespace}, {bufnr}) *vim.diagnostic.reset()* Remove all diagnostics from the given namespace. @@ -674,17 +674,17 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()* re-displayed, use |vim.diagnostic.hide()|. Parameters: ~ - • {namespace} (number|nil) Diagnostic namespace. When omitted, remove diagnostics from all + • {namespace} (integer|nil) Diagnostic namespace. When omitted, remove diagnostics from all namespaces. - • {bufnr} (number|nil) Remove diagnostics for the given buffer. + • {bufnr} (integer|nil) Remove diagnostics for the given buffer. When omitted, diagnostics are removed for all buffers. 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 + • {namespace} (integer) The diagnostic namespace + • {bufnr} (integer) Buffer number • {diagnostics} (table) A list of diagnostic items |diagnostic-structure| • {opts} (table|nil) Display options to pass to @@ -723,9 +723,9 @@ show({namespace}, {bufnr}, {diagnostics}, {opts}) Display diagnostics for the given namespace and buffer. Parameters: ~ - • {namespace} (number|nil) Diagnostic namespace. When omitted, show diagnostics from all + • {namespace} (integer|nil) Diagnostic namespace. When omitted, show diagnostics from all namespaces. - • {bufnr} (number|nil) Buffer number, or 0 for current buffer. + • {bufnr} (integer|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 diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 6fd000a029..56532d0184 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -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 |