Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/spoom/sorbet/metrics/code_metrics_visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def collect_code_metrics(files)
# On the other hand, the metrics file is a snapshot of the metrics at type checking time and knows about
# is calls are typed, how many assertions are done, etc.
class CodeMetricsVisitor < Spoom::Visitor
include RBS::ExtractRBSComments
include Spoom::RBS::ExtractRBSComments

#: (Spoom::Counters) -> void
def initialize(counters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def visit_attr(node)
end
end

#: (Prism::DefNode, RBS::Comments) -> void
#: (Prism::DefNode, Spoom::RBS::Comments) -> void
def rewrite_def(def_node, comments)
return if comments.empty?
return if comments.signatures.empty?
Expand Down Expand Up @@ -176,15 +176,15 @@ def rewrite_def(def_node, comments)
end
end

#: (Array[RBS::Signature], method_name: String, location: String) -> Array[RBS::Signature]
#: (Array[Spoom::RBS::Signature], method_name: String, location: String) -> Array[Spoom::RBS::Signature]
def apply_overloads_strategy(signatures, method_name:, location:)
return signatures if signatures.size <= 1

case @overloads_strategy
when :translate_all
signatures
when :translate_last
kept = signatures.last #: as RBS::Signature
kept = signatures.last #: as Spoom::RBS::Signature
others = signatures[0...-1] #: as !nil

# Delete all the signatures we didn't keep
Expand Down Expand Up @@ -300,7 +300,7 @@ def apply_class_annotations(node)
end
end

#: (Array[RBS::Annotation], RBI::Sig) -> void
#: (Array[Spoom::RBS::Annotation], RBI::Sig) -> void
def apply_member_annotations(annotations, sig)
annotations.each do |annotation|
case annotation.string
Expand Down Expand Up @@ -340,9 +340,9 @@ def already_extends?(node, constant_regex)
end
end

#: (Array[Prism::Comment]) -> Array[RBS::TypeAlias]
#: (Array[Prism::Comment]) -> Array[Spoom::RBS::TypeAlias]
def collect_type_aliases(comments)
type_aliases = [] #: Array[RBS::TypeAlias]
type_aliases = [] #: Array[Spoom::RBS::TypeAlias]

return type_aliases if comments.empty?

Expand Down
Loading