Skip to content

Commit e11a3ff

Browse files
committed
Use Rubydex graph for constants_from_requested_paths
1 parent 8dc38ea commit e11a3ff

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

lib/tapioca/commands/abstract_dsl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def generate_command_for(constant)
359359
#: -> Array[String]
360360
def constants_from_requested_paths
361361
@constants_from_requested_paths ||=
362-
Static::SymbolLoader.symbols_from_paths(@requested_paths).to_a #: Array[String]?
362+
Static::SymbolLoader.graph_from_paths(@requested_paths).declarations.map(&:name) #: Array[String]?
363363
end
364364
end
365365
end

lib/tapioca/static/symbol_loader.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,6 @@ def engine_symbols(gem)
5252
Set.new
5353
end
5454

55-
#: (Array[Pathname] paths) -> Set[String]
56-
def symbols_from_paths(paths)
57-
return Set.new if paths.empty?
58-
59-
output = Tempfile.create("sorbet") do |file|
60-
file.write(Array(paths).join("\n"))
61-
file.flush
62-
63-
symbol_table_json_from("@#{file.path.shellescape}")
64-
end
65-
66-
return Set.new if output.empty?
67-
68-
SymbolTableParser.parse_json(output)
69-
end
70-
7155
private
7256

7357
# @without_runtime

0 commit comments

Comments
 (0)