@@ -48,7 +48,7 @@ def visit_def_node(node)
4848 translator = RBI ::RBS ::MethodTypeTranslator . new ( rbi_node )
4949 translator . visit ( method_type )
5050 sig = translator . result
51- apply_member_annotations ( comments . annotations , sig )
51+ apply_member_annotations ( comments . method_annotations , sig )
5252
5353 @rewriter << Source ::Replace . new (
5454 signature . location . start_offset ,
@@ -99,7 +99,7 @@ def visit_attr(node)
9999
100100 sig . return_type = RBI ::RBS ::TypeTranslator . translate ( attr_type )
101101
102- apply_member_annotations ( comments . annotations , sig )
102+ apply_member_annotations ( comments . method_annotations , sig )
103103
104104 @rewriter << Source ::Replace . new (
105105 signature . location . start_offset ,
@@ -127,12 +127,13 @@ def apply_class_annotations(node)
127127 node . expression . location . end_offset
128128 end
129129
130- if comments . annotations . any?
130+ class_annotations = comments . class_annotations
131+ if class_annotations . any?
131132 unless already_extends? ( node , /^(::)?T::Helpers$/ )
132133 @rewriter << Source ::Insert . new ( insert_pos , "\n #{ indent } extend T::Helpers\n " )
133134 end
134135
135- comments . annotations . reverse_each do |annotation |
136+ class_annotations . reverse_each do |annotation |
136137 from = adjust_to_line_start ( annotation . location . start_offset )
137138 to = adjust_to_line_end ( annotation . location . end_offset )
138139
@@ -209,7 +210,7 @@ def apply_class_annotations(node)
209210 end
210211 end
211212
212- #: (Array[RBS::Annotations ], RBI::Sig) -> void
213+ #: (Array[RBS::Annotation ], RBI::Sig) -> void
213214 def apply_member_annotations ( annotations , sig )
214215 annotations . each do |annotation |
215216 case annotation . string
0 commit comments