lib/spoom/deadcode/plugins/active_support.rb in spoom-1.2.4 vs lib/spoom/deadcode/plugins/active_support.rb in spoom-1.3.0

- old
+ new

@@ -13,9 +13,20 @@ "after_teardown", "before_all", "before_setup", "before_teardown", ) + + SETUP_AND_TEARDOWN_METHODS = T.let(["setup", "teardown"], T::Array[String]) + + sig { override.params(indexer: Indexer, send: Send).void } + def on_send(indexer, send) + return unless send.recv.nil? && SETUP_AND_TEARDOWN_METHODS.include?(send.name) + + send.each_arg(Prism::SymbolNode) do |arg| + indexer.reference_method(T.must(arg.value), send.node) + end + end end end end end