Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/tapioca/runtime/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,16 @@ def resolve_loc(locations)

#: (T::Module[top] constant) -> Set[String]
def file_candidates_for(constant)
relevant_methods_for(constant).filter_map do |method|
# Grab all source files for (relevant) methods defined on the constant
candidates = relevant_methods_for(constant).filter_map do |method|
method.source_location&.first
end.to_set

# Add the source file for the constant definition itself, if available.
source_location_candidate = const_source_location(name_of(constant).to_s)&.file
candidates.add(source_location_candidate) if source_location_candidate

candidates
end

#: (T::Module[top] constant) -> untyped
Expand Down
Loading