Skip to content

Commit 7dd617d

Browse files
committed
type
1 parent b763257 commit 7dd617d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/java-deps/views/data_node.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,12 @@ function DataNode:revealPaths(paths)
236236
if kind == NodeKind.PackageRoot then
237237
local hierarchicalNodeData = paths[1]
238238
local children = self:getChildren()
239-
---@type DataNode?
239+
---@type DataNode[]?
240240
local childNode = vim.tbl_filter(function(child)
241241
return vim.startswith(hierarchicalNodeData.name, child._nodeData.name .. ".")
242242
or hierarchicalNodeData.name == child._nodeData.name
243243
end, children)
244+
---@type DataNode?
244245
childNode = childNode and #childNode > 0 and childNode[1] or nil
245246
if childNode and not childNode[1]._hierarchicalNode then
246247
table.remove(paths, 1)
@@ -253,11 +254,12 @@ function DataNode:revealPaths(paths)
253254
return self:revealPaths(paths)
254255
else
255256
local children = self:getChildren()
256-
---@type DataNode?
257+
---@type DataNode[]?
257258
local childNode = vim.tbl_filter(function(child)
258259
return vim.startswith(hierarchicalNodeData.name, child._nodeData.name .. ".")
259260
or hierarchicalNodeData.name == child._nodeData.name
260261
end, children)
262+
---@type DataNode?
261263
childNode = childNode and #childNode > 0 and childNode[1] or nil
262264
return (childNode and #paths > 0) and childNode:revealPaths(paths) or nil
263265
end

0 commit comments

Comments
 (0)