@@ -40,14 +40,13 @@ local Api = {
4040 diagnostics = {},
4141}
4242
43- --- Print error when setup not called.
44- --- f function to invoke
45- --- @param f function
46- --- @return fun ( ... ) : any
47- local function wrap (f )
43+ --- Print error when setup not called.
44+ --- @param fn fun ( ... ): any
45+ --- @return fun ( ... ): any
46+ local function wrap (fn )
4847 return function (...)
4948 if vim .g .NvimTreeSetup == 1 then
50- return f (... )
49+ return fn (... )
5150 else
5251 notify .error (" nvim-tree setup not called" )
5352 end
5756--- Invoke a method on the singleton explorer.
5857--- Print error when setup not called.
5958--- @param explorer_method string explorer method name
60- --- @return fun ( ... ) : any
59+ --- @return fun ( ... ): any
6160local function wrap_explorer (explorer_method )
6261 return wrap (function (...)
6362 local explorer = core .get_explorer ()
@@ -68,7 +67,8 @@ local function wrap_explorer(explorer_method)
6867end
6968
7069--- Inject the node as the first argument if present otherwise do nothing.
71- --- @param fn function function to invoke
70+ --- @param fn fun ( node : Node , ... ): any
71+ --- @return fun ( node : Node , ... ): any
7272local function wrap_node (fn )
7373 return function (node , ...)
7474 node = node or wrap_explorer (" get_node_at_cursor" )()
@@ -79,7 +79,8 @@ local function wrap_node(fn)
7979end
8080
8181--- Inject the node or nil as the first argument if absent.
82- --- @param fn function function to invoke
82+ --- @param fn fun ( node : Node , ... ): any
83+ --- @return fun ( node : Node , ... ): any
8384local function wrap_node_or_nil (fn )
8485 return function (node , ...)
8586 node = node or wrap_explorer (" get_node_at_cursor" )()
9192--- Print error when setup not called.
9293--- @param explorer_member string explorer member name
9394--- @param member_method string method name to invoke on member
94- --- @return fun ( ... ) : any
95+ --- @return fun ( ... ): any
9596local function wrap_explorer_member (explorer_member , member_method )
9697 return wrap (function (...)
9798 local explorer = core .get_explorer ()
@@ -210,6 +211,7 @@ local function edit(mode, node)
210211end
211212
212213--- @param mode string
214+ --- @param toggle_group boolean ?
213215--- @return fun ( node : Node )
214216local function open_or_expand_or_dir_up (mode , toggle_group )
215217 --- @param node Node
0 commit comments