Skip to content

Commit cf17675

Browse files
committed
tidy
1 parent ebe5cca commit cf17675

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lua/nvim-tree/node/init.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
local git = require("nvim-tree.git")
22

3-
---TODO remove all @cast, @as
3+
---TODO remove all @cast
44
---TODO remove all references to directory fields:
5-
------@field has_children boolean
6-
------@field group_next Node? -- If node is grouped, this points to the next child dir/link node
7-
------@field nodes Node[]
8-
------@field open boolean
9-
------@field hidden_stats table? -- Each field of this table is a key for source and value for count
105

116
---Abstract Node class.
127
---Uses the abstract factory pattern to instantiate child instances.
@@ -111,7 +106,8 @@ end
111106
-- If node is grouped, return the last node in the group. Otherwise, return the given node.
112107
---@return Node
113108
function BaseNode:last_group_node()
114-
local node = self --[[@as BaseNode]]
109+
local node = self
110+
--- @cast node BaseNode
115111

116112
while node.group_next do
117113
node = node.group_next
@@ -239,7 +235,6 @@ function BaseNode:expand_or_collapse(toggle_group)
239235
end
240236

241237
local head_node = self:get_parent_of_group()
242-
---@cast head_node DirectoryNode -- TODO move this to the class
243238
if toggle_group then
244239
head_node:toggle_group_folders()
245240
end

0 commit comments

Comments
 (0)