@@ -7,6 +7,13 @@ module Translate
77 class RBSCommentsToSorbetSigs < Translator
88 include Spoom ::RBS ::ExtractRBSComments
99
10+ #: (String, file: String, ?max_line_length: Integer?) -> void
11+ def initialize ( ruby_contents , file :, max_line_length : nil )
12+ super ( ruby_contents , file : file )
13+
14+ @max_line_length = max_line_length
15+ end
16+
1017 # @override
1118 #: (Prism::ClassNode node) -> void
1219 def visit_class_node ( node )
@@ -53,7 +60,7 @@ def visit_def_node(node)
5360 @rewriter << Source ::Replace . new (
5461 signature . location . start_offset ,
5562 signature . location . end_offset ,
56- sig . string ,
63+ sig . string ( max_line_length : @max_line_length ) ,
5764 )
5865 rescue ::RBS ::ParsingError , ::RBI ::Error
5966 # Ignore signatures with errors
@@ -104,7 +111,7 @@ def visit_attr(node)
104111 @rewriter << Source ::Replace . new (
105112 signature . location . start_offset ,
106113 signature . location . end_offset ,
107- sig . string ,
114+ sig . string ( max_line_length : @max_line_length ) ,
108115 )
109116 rescue ::RBS ::ParsingError , ::RBI ::Error
110117 # Ignore signatures with errors
0 commit comments