Skip to content

Commit 0e81ee4

Browse files
committed
Simplified fix - minimal changes (Sun Nov 30 20:54:31 PST 2025)
1 parent fc1f967 commit 0e81ee4

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lua/treewalker/targets.lua

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ function M.out(node)
1616
-- node below the comment
1717
-- Note: For some reason, this isn't required locally (macos _or_ Makefile ubuntu,
1818
-- but does fail on CI. TODO figure out the differences)
19-
-- Try multiple times to escape comment nodes on CI
20-
local max_attempts = 3
21-
local attempts = 0
22-
while (nodes.is_comment_node(node) or nodes.is_augment_target(node)) and attempts < max_attempts do
23-
local next_node = M.down(node, nodes.get_srow(node))
24-
if not next_node or next_node == node then
25-
break -- Can't move down further, stop trying
19+
-- On CI, comment nodes behave differently - work from parent instead
20+
if nodes.is_comment_node(node) or nodes.is_augment_target(node) then
21+
local parent = node:parent()
22+
if parent then
23+
node = parent
2624
end
27-
node = next_node
28-
attempts = attempts + 1
2925
end
3026

3127
local candidate = strategies.get_first_ancestor_with_diff_scol(node)

0 commit comments

Comments
 (0)