Skip to content

Commit 5fa9e45

Browse files
committed
Use Rubydex graph for constants_from_requested_paths
1 parent eeebd71 commit 5fa9e45

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
@@ -60,22 +60,6 @@ def engine_symbols(gem)
6060
Set.new
6161
end
6262

63-
#: (Array[Pathname] paths) -> Set[String]
64-
def symbols_from_paths(paths)
65-
return Set.new if paths.empty?
66-
67-
output = Tempfile.create("sorbet") do |file|
68-
file.write(Array(paths).join("\n"))
69-
file.flush
70-
71-
symbol_table_json_from("@#{file.path.shellescape}")
72-
end
73-
74-
return Set.new if output.empty?
75-
76-
SymbolTableParser.parse_json(output)
77-
end
78-
7963
private
8064

8165
# @without_runtime

0 commit comments

Comments
 (0)