Skip to content

Commit

Permalink
Implementation: allow to lookup implementations of class and module
Browse files Browse the repository at this point in the history
  • Loading branch information
makenowjust committed May 5, 2019
1 parent 786f2ac commit fe0403b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compiler/crystal/tools/implementations.cr
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ module Crystal
end
end

def visit(node : Path)
return contains_target(node) unless (loc = node.location) && (end_loc = node.end_location) && @target_location.between?(loc, end_loc)

target = node.target_const || node.type?.try &.instance_type
target.try &.locations.try &.each do |loc|
@locations << loc
end
end

def visit(node)
contains_target(node)
end
Expand Down

0 comments on commit fe0403b

Please sign in to comment.