We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96ba1a9 commit 74278faCopy full SHA for 74278fa
lua/treewalker/targets.lua
@@ -35,6 +35,13 @@ function M.out(node)
35
if not candidate then
36
candidate = strategies.get_first_ancestor_jump_target(node)
37
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
45
candidate = coincident(candidate)
46
if not candidate then return end
47
local row = nodes.get_srow(candidate)
0 commit comments