chore: enable incomplete-signature-doc, format nvt-min.lua, assorted formatting tidies (#2967)

* chore: luacheckrc uses table

* chore: format nvt-min.lua

* chore: complete lua doc

* chore: complete lua doc

* chore: complete lua doc

* chore: complete lua doc

* chore: complete lua doc

* chore: enable incomplete-signature-doc

* chore: enable incomplete-signature-doc

* chore: complete lua doc

* chore: complete lua doc
This commit is contained in:
Alexander Courtis
2024-10-25 14:25:30 +11:00
committed by GitHub
parent 68be6df2fc
commit 077af9f990
17 changed files with 54 additions and 33 deletions

View File

@@ -42,13 +42,12 @@ local Api = {
}
--- Print error when setup not called.
--- f function to invoke
---@param f function
---@return fun(...) : any
local function wrap(f)
---@param fn fun(...): any
---@return fun(...): any
local function wrap(fn)
return function(...)
if vim.g.NvimTreeSetup == 1 then
return f(...)
return fn(...)
else
notify.error("nvim-tree setup not called")
end
@@ -56,7 +55,8 @@ local function wrap(f)
end
---Inject the node as the first argument if present otherwise do nothing.
---@param fn function function to invoke
---@param fn fun(node: Node, ...): any
---@return fun(node: Node, ...): any
local function wrap_node(fn)
return function(node, ...)
node = node or lib.get_node_at_cursor()
@@ -67,7 +67,8 @@ local function wrap_node(fn)
end
---Inject the node or nil as the first argument if absent.
---@param fn function function to invoke
---@param fn fun(node: Node, ...): any
---@return fun(node: Node, ...): any
local function wrap_node_or_nil(fn)
return function(node, ...)
node = node or lib.get_node_at_cursor()
@@ -78,7 +79,7 @@ end
---Invoke a method on the singleton explorer.
---Print error when setup not called.
---@param explorer_method string explorer method name
---@return fun(...) : any
---@return fun(...): any
local function wrap_explorer(explorer_method)
return wrap(function(...)
local explorer = core.get_explorer()
@@ -92,7 +93,7 @@ end
---Print error when setup not called.
---@param explorer_member string explorer member name
---@param member_method string method name to invoke on member
---@return fun(...) : any
---@return fun(...): any
local function wrap_explorer_member(explorer_member, member_method)
return wrap(function(...)
local explorer = core.get_explorer()
@@ -211,6 +212,7 @@ local function edit(mode, node)
end
---@param mode string
---@param toggle_group boolean?
---@return fun(node: Node)
local function open_or_expand_or_dir_up(mode, toggle_group)
---@param node Node