@@ -42,21 +42,21 @@ local Api = {
42
42
}
43
43
44
44
--- Print error when setup not called.
45
- --- f function to invoke
46
- --- @param f function
47
- --- @return fun ( ... ) : any
48
- local function wrap (f )
45
+ --- @param fn fun ( ... ): any
46
+ --- @return fun ( ... ): any
47
+ local function wrap (fn )
49
48
return function (...)
50
49
if vim .g .NvimTreeSetup == 1 then
51
- return f (... )
50
+ return fn (... )
52
51
else
53
52
notify .error (" nvim-tree setup not called" )
54
53
end
55
54
end
56
55
end
57
56
58
57
--- Inject the node as the first argument if present otherwise do nothing.
59
- --- @param fn function function to invoke
58
+ --- @param fn fun ( node : Node , ... ): any
59
+ --- @return fun ( node : Node , ... ): any
60
60
local function wrap_node (fn )
61
61
return function (node , ...)
62
62
node = node or lib .get_node_at_cursor ()
@@ -67,7 +67,8 @@ local function wrap_node(fn)
67
67
end
68
68
69
69
--- Inject the node or nil as the first argument if absent.
70
- --- @param fn function function to invoke
70
+ --- @param fn fun ( node : Node , ... ): any
71
+ --- @return fun ( node : Node , ... ): any
71
72
local function wrap_node_or_nil (fn )
72
73
return function (node , ...)
73
74
node = node or lib .get_node_at_cursor ()
78
79
--- Invoke a method on the singleton explorer.
79
80
--- Print error when setup not called.
80
81
--- @param explorer_method string explorer method name
81
- --- @return fun ( ... ) : any
82
+ --- @return fun ( ... ): any
82
83
local function wrap_explorer (explorer_method )
83
84
return wrap (function (...)
84
85
local explorer = core .get_explorer ()
92
93
--- Print error when setup not called.
93
94
--- @param explorer_member string explorer member name
94
95
--- @param member_method string method name to invoke on member
95
- --- @return fun ( ... ) : any
96
+ --- @return fun ( ... ): any
96
97
local function wrap_explorer_member (explorer_member , member_method )
97
98
return wrap (function (...)
98
99
local explorer = core .get_explorer ()
@@ -211,6 +212,7 @@ local function edit(mode, node)
211
212
end
212
213
213
214
--- @param mode string
215
+ --- @param toggle_group boolean ?
214
216
--- @return fun ( node : Node )
215
217
local function open_or_expand_or_dir_up (mode , toggle_group )
216
218
--- @param node Node
0 commit comments