fix: resolve pre-existing LuaLS typecheck warnings
Problem: CI typecheck fails with 13 warnings — 11 need-check-nil in
util.render_text (opts param annotated nil|table but guaranteed non-nil
after tbl_deep_extend), 1 undefined-doc-param in view.render_buffer_async
(annotation says "callback" but param is "caller_callback"), and 1
need-check-nil on opts in the same function.
Solution: add ---@cast opts -nil after the tbl_deep_extend call, fix
the param name in the doc annotation, and add opts = opts or {} guard.
This commit is contained in:
parent
209d631cb9
commit
642f745038
2 changed files with 3 additions and 1 deletions
|
|
@ -582,6 +582,7 @@ M.render_text = function(bufnr, text, opts)
|
|||
h_align = "center",
|
||||
v_align = "center",
|
||||
})
|
||||
---@cast opts -nil
|
||||
if not vim.api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -909,8 +909,9 @@ local pending_renders = {}
|
|||
---@param bufnr integer
|
||||
---@param opts nil|table
|
||||
--- refetch nil|boolean Defaults to true
|
||||
---@param callback nil|fun(err: nil|string)
|
||||
---@param caller_callback nil|fun(err: nil|string)
|
||||
M.render_buffer_async = function(bufnr, opts, caller_callback)
|
||||
opts = opts or {}
|
||||
local function callback(err)
|
||||
if not err then
|
||||
vim.api.nvim_exec_autocmds(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue