@@ -42,8 +42,8 @@ local Api = {
4242}
4343
4444--- Print error when setup not called.
45- --- @param fn fun ( ... )
46- --- @return fun ( ... )
45+ --- @param fn fun ( ... ): any
46+ --- @return fun ( ... ): any
4747local function wrap (fn )
4848 return function (...)
4949 if vim .g .NvimTreeSetup == 1 then
@@ -55,8 +55,8 @@ local function wrap(fn)
5555end
5656
5757--- Inject the node as the first argument if present otherwise do nothing.
58- --- @param fn fun ( node : Node , ... )
59- --- @return fun ( node : Node , ... )
58+ --- @param fn fun ( node : Node , ... ): any
59+ --- @return fun ( node : Node , ... ): any
6060local function wrap_node (fn )
6161 return function (node , ...)
6262 node = node or lib .get_node_at_cursor ()
@@ -67,8 +67,8 @@ local function wrap_node(fn)
6767end
6868
6969--- Inject the node or nil as the first argument if absent.
70- --- @param fn fun ( node : Node , ... )
71- --- @return fun ( node : Node , ... )
70+ --- @param fn fun ( node : Node , ... ): any
71+ --- @return fun ( node : Node , ... ): any
7272local function wrap_node_or_nil (fn )
7373 return function (node , ...)
7474 node = node or lib .get_node_at_cursor ()
7979--- Invoke a method on the singleton explorer.
8080--- Print error when setup not called.
8181--- @param explorer_method string explorer method name
82- --- @return fun ( ... ) : any
82+ --- @return fun ( ... ): any
8383local function wrap_explorer (explorer_method )
8484 return wrap (function (...)
8585 local explorer = core .get_explorer ()
9393--- Print error when setup not called.
9494--- @param explorer_member string explorer member name
9595--- @param member_method string method name to invoke on member
96- --- @return fun ( ... ) : any
96+ --- @return fun ( ... ): any
9797local function wrap_explorer_member (explorer_member , member_method )
9898 return wrap (function (...)
9999 local explorer = core .get_explorer ()
@@ -288,7 +288,7 @@ Api.config.mappings.default_on_attach = keymap.default_on_attach
288288Api .diagnostics .hi_test = wrap (appearance_diagnostics .hi_test )
289289
290290Api .commands .get = wrap (function ()
291- require (" nvim-tree.commands" ).get ()
291+ return require (" nvim-tree.commands" ).get ()
292292end )
293293
294294return Api
0 commit comments