Skip to content

Commit 74278fa

Browse files
committed
Prev still failed CI
1 parent 96ba1a9 commit 74278fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lua/treewalker/targets.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ function M.out(node)
3535
if not candidate then
3636
candidate = strategies.get_first_ancestor_jump_target(node)
3737
end
38+
-- When in a comment inside a body, prefer the parent declaration
39+
if node:type():match("comment") and candidate and candidate:type():match("body") then
40+
local declaration = candidate:parent()
41+
if declaration and nodes.is_jump_target(declaration) then
42+
candidate = declaration
43+
end
44+
end
3845
candidate = coincident(candidate)
3946
if not candidate then return end
4047
local row = nodes.get_srow(candidate)

0 commit comments

Comments
 (0)