rbi 0.0.16 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rbi/formatter.rb +15 -9
- data/lib/rbi/index.rb +19 -5
- data/lib/rbi/loc.rb +18 -3
- data/lib/rbi/model.rb +52 -42
- data/lib/rbi/parser.rb +632 -539
- data/lib/rbi/printer.rb +5 -3
- data/lib/rbi/rewriters/add_sig_templates.rb +2 -2
- data/lib/rbi/rewriters/annotate.rb +2 -1
- data/lib/rbi/rewriters/deannotate.rb +1 -0
- data/lib/rbi/rewriters/merge_trees.rb +23 -12
- data/lib/rbi/rewriters/nest_non_public_methods.rb +1 -0
- data/lib/rbi/rewriters/nest_singleton_methods.rb +1 -0
- data/lib/rbi/rewriters/remove_known_definitions.rb +16 -12
- data/lib/rbi/rewriters/sort_nodes.rb +21 -9
- data/lib/rbi/version.rb +1 -1
- data/lib/rbi.rb +0 -5
- metadata +7 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a2cb2f6b2287a3faed50161d70e0c863892c88c6eef5a3c798ccf8e16e0c441
|
4
|
+
data.tar.gz: e851f3b85aa62534a3a1c867085add40aa7669df3b003f17e62eb81ce36c58ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b566ecfc9c01ebf7524efb055302e3da780caf0e0cc3ab36bdca798ff8390cce5247bce1318c5373c8339fede498f3bc87ffd5071ace658880c0b3724a9f1d15
|
7
|
+
data.tar.gz: d95c6b6ea53cf84c348b2426b9bf10ad8213282f48ec9364cb9b1512aef9dd4c896d18c09c1dac79abe40f136194ab550571ac141e960eab61e4026bdbf3c578
|
data/Gemfile
CHANGED
@@ -10,7 +10,7 @@ group(:development, :test) do
|
|
10
10
|
gem("minitest")
|
11
11
|
gem("minitest-reporters")
|
12
12
|
gem("rake", "~> 13.0")
|
13
|
-
gem("rubocop", "~> 1.
|
13
|
+
gem("rubocop", "~> 1.56", require: false)
|
14
14
|
gem("rubocop-shopify", require: false)
|
15
15
|
gem("rubocop-sorbet", require: false)
|
16
16
|
gem("sorbet", ">= 0.5.9204", require: false)
|
data/lib/rbi/formatter.rb
CHANGED
@@ -5,8 +5,20 @@ module RBI
|
|
5
5
|
class Formatter
|
6
6
|
extend T::Sig
|
7
7
|
|
8
|
-
sig { returns(T::Boolean) }
|
9
|
-
|
8
|
+
sig { params(sort_nodes: T::Boolean).returns(T::Boolean) }
|
9
|
+
attr_writer :sort_nodes
|
10
|
+
|
11
|
+
sig { params(nest_singleton_methods: T::Boolean).returns(T::Boolean) }
|
12
|
+
attr_writer :nest_singleton_methods
|
13
|
+
|
14
|
+
sig { params(add_sig_templates: T::Boolean).returns(T::Boolean) }
|
15
|
+
attr_writer :add_sig_templates
|
16
|
+
|
17
|
+
sig { params(group_nodes: T::Boolean).returns(T::Boolean) }
|
18
|
+
attr_writer :group_nodes
|
19
|
+
|
20
|
+
sig { params(nest_non_public_methods: T::Boolean).returns(T::Boolean) }
|
21
|
+
attr_writer :nest_non_public_methods
|
10
22
|
|
11
23
|
sig { returns(T.nilable(Integer)) }
|
12
24
|
attr_accessor :max_line_length
|
@@ -18,7 +30,7 @@ module RBI
|
|
18
30
|
max_line_length: T.nilable(Integer),
|
19
31
|
nest_singleton_methods: T::Boolean,
|
20
32
|
nest_non_public_methods: T::Boolean,
|
21
|
-
sort_nodes: T::Boolean
|
33
|
+
sort_nodes: T::Boolean,
|
22
34
|
).void
|
23
35
|
end
|
24
36
|
def initialize(
|
@@ -43,12 +55,6 @@ module RBI
|
|
43
55
|
file.string(max_line_length: @max_line_length)
|
44
56
|
end
|
45
57
|
|
46
|
-
sig { params(tree: RBI::Tree).returns(String) }
|
47
|
-
def print_tree(tree)
|
48
|
-
format_tree(tree)
|
49
|
-
tree.string(max_line_length: @max_line_length)
|
50
|
-
end
|
51
|
-
|
52
58
|
sig { params(file: RBI::File).void }
|
53
59
|
def format_file(file)
|
54
60
|
format_tree(file.root)
|
data/lib/rbi/index.rb
CHANGED
@@ -6,11 +6,15 @@ module RBI
|
|
6
6
|
extend T::Sig
|
7
7
|
include T::Enumerable
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
index
|
9
|
+
class << self
|
10
|
+
extend T::Sig
|
11
|
+
|
12
|
+
sig { params(node: Node).returns(Index) }
|
13
|
+
def index(*node)
|
14
|
+
index = Index.new
|
15
|
+
index.visit_all(node)
|
16
|
+
index
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
sig { void }
|
@@ -171,6 +175,16 @@ module RBI
|
|
171
175
|
end
|
172
176
|
end
|
173
177
|
|
178
|
+
class TypeMember
|
179
|
+
extend T::Sig
|
180
|
+
include Indexable
|
181
|
+
|
182
|
+
sig { override.returns(T::Array[String]) }
|
183
|
+
def index_ids
|
184
|
+
[to_s]
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
174
188
|
class Send
|
175
189
|
extend T::Sig
|
176
190
|
include Indexable
|
data/lib/rbi/loc.rb
CHANGED
@@ -5,6 +5,21 @@ module RBI
|
|
5
5
|
class Loc
|
6
6
|
extend T::Sig
|
7
7
|
|
8
|
+
class << self
|
9
|
+
extend T::Sig
|
10
|
+
|
11
|
+
sig { params(file: String, yarp_location: YARP::Location).returns(Loc) }
|
12
|
+
def from_yarp(file, yarp_location)
|
13
|
+
new(
|
14
|
+
file: file,
|
15
|
+
begin_line: yarp_location.start_line,
|
16
|
+
end_line: yarp_location.end_line,
|
17
|
+
begin_column: yarp_location.start_column,
|
18
|
+
end_column: yarp_location.end_column + 1, # TODO: Why is this off by one?
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
8
23
|
sig { returns(T.nilable(String)) }
|
9
24
|
attr_reader :file
|
10
25
|
|
@@ -17,7 +32,7 @@ module RBI
|
|
17
32
|
begin_line: T.nilable(Integer),
|
18
33
|
end_line: T.nilable(Integer),
|
19
34
|
begin_column: T.nilable(Integer),
|
20
|
-
end_column: T.nilable(Integer)
|
35
|
+
end_column: T.nilable(Integer),
|
21
36
|
).void
|
22
37
|
end
|
23
38
|
def initialize(file: nil, begin_line: nil, end_line: nil, begin_column: nil, end_column: nil)
|
@@ -36,8 +51,8 @@ module RBI
|
|
36
51
|
sig { returns(T.nilable(String)) }
|
37
52
|
def source
|
38
53
|
file = self.file
|
39
|
-
return
|
40
|
-
return
|
54
|
+
return unless file
|
55
|
+
return unless ::File.file?(file)
|
41
56
|
|
42
57
|
return ::File.read(file) unless begin_line && end_line
|
43
58
|
|
data/lib/rbi/model.rb
CHANGED
@@ -24,6 +24,7 @@ module RBI
|
|
24
24
|
def detach
|
25
25
|
tree = parent_tree
|
26
26
|
return unless tree
|
27
|
+
|
27
28
|
tree.nodes.delete(self)
|
28
29
|
self.parent_tree = nil
|
29
30
|
end
|
@@ -32,8 +33,10 @@ module RBI
|
|
32
33
|
def replace(node)
|
33
34
|
tree = parent_tree
|
34
35
|
raise unless tree
|
36
|
+
|
35
37
|
index = tree.nodes.index(self)
|
36
38
|
raise unless index
|
39
|
+
|
37
40
|
tree.nodes[index] = node
|
38
41
|
node.parent_tree = tree
|
39
42
|
self.parent_tree = nil
|
@@ -62,6 +65,7 @@ module RBI
|
|
62
65
|
sig { params(other: Object).returns(T::Boolean) }
|
63
66
|
def ==(other)
|
64
67
|
return false unless other.is_a?(Comment)
|
68
|
+
|
65
69
|
text == other.text
|
66
70
|
end
|
67
71
|
end
|
@@ -109,7 +113,7 @@ module RBI
|
|
109
113
|
params(
|
110
114
|
loc: T.nilable(Loc),
|
111
115
|
comments: T::Array[Comment],
|
112
|
-
block: T.nilable(T.proc.params(node: Tree).void)
|
116
|
+
block: T.nilable(T.proc.params(node: Tree).void),
|
113
117
|
).void
|
114
118
|
end
|
115
119
|
def initialize(loc: nil, comments: [], &block)
|
@@ -146,7 +150,7 @@ module RBI
|
|
146
150
|
params(
|
147
151
|
strictness: T.nilable(String),
|
148
152
|
comments: T::Array[Comment],
|
149
|
-
block: T.nilable(T.proc.params(file: File).void)
|
153
|
+
block: T.nilable(T.proc.params(file: File).void),
|
150
154
|
).void
|
151
155
|
end
|
152
156
|
def initialize(strictness: nil, comments: [], &block)
|
@@ -194,7 +198,7 @@ module RBI
|
|
194
198
|
name: String,
|
195
199
|
loc: T.nilable(Loc),
|
196
200
|
comments: T::Array[Comment],
|
197
|
-
block: T.nilable(T.proc.params(node: Module).void)
|
201
|
+
block: T.nilable(T.proc.params(node: Module).void),
|
198
202
|
).void
|
199
203
|
end
|
200
204
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -206,6 +210,7 @@ module RBI
|
|
206
210
|
sig { override.returns(String) }
|
207
211
|
def fully_qualified_name
|
208
212
|
return name if name.start_with?("::")
|
213
|
+
|
209
214
|
"#{parent_scope&.fully_qualified_name}::#{name}"
|
210
215
|
end
|
211
216
|
end
|
@@ -225,7 +230,7 @@ module RBI
|
|
225
230
|
superclass_name: T.nilable(String),
|
226
231
|
loc: T.nilable(Loc),
|
227
232
|
comments: T::Array[Comment],
|
228
|
-
block: T.nilable(T.proc.params(node: Class).void)
|
233
|
+
block: T.nilable(T.proc.params(node: Class).void),
|
229
234
|
).void
|
230
235
|
end
|
231
236
|
def initialize(name, superclass_name: nil, loc: nil, comments: [], &block)
|
@@ -238,6 +243,7 @@ module RBI
|
|
238
243
|
sig { override.returns(String) }
|
239
244
|
def fully_qualified_name
|
240
245
|
return name if name.start_with?("::")
|
246
|
+
|
241
247
|
"#{parent_scope&.fully_qualified_name}::#{name}"
|
242
248
|
end
|
243
249
|
end
|
@@ -249,7 +255,7 @@ module RBI
|
|
249
255
|
params(
|
250
256
|
loc: T.nilable(Loc),
|
251
257
|
comments: T::Array[Comment],
|
252
|
-
block: T.nilable(T.proc.params(node: SingletonClass).void)
|
258
|
+
block: T.nilable(T.proc.params(node: SingletonClass).void),
|
253
259
|
).void
|
254
260
|
end
|
255
261
|
def initialize(loc: nil, comments: [], &block)
|
@@ -282,7 +288,7 @@ module RBI
|
|
282
288
|
keyword_init: T::Boolean,
|
283
289
|
loc: T.nilable(Loc),
|
284
290
|
comments: T::Array[Comment],
|
285
|
-
block: T.nilable(T.proc.params(struct: Struct).void)
|
291
|
+
block: T.nilable(T.proc.params(struct: Struct).void),
|
286
292
|
).void
|
287
293
|
end
|
288
294
|
def initialize(name, members: [], keyword_init: false, loc: nil, comments: [], &block)
|
@@ -296,6 +302,7 @@ module RBI
|
|
296
302
|
sig { override.returns(String) }
|
297
303
|
def fully_qualified_name
|
298
304
|
return name if name.start_with?("::")
|
305
|
+
|
299
306
|
"#{parent_scope&.fully_qualified_name}::#{name}"
|
300
307
|
end
|
301
308
|
end
|
@@ -314,7 +321,7 @@ module RBI
|
|
314
321
|
value: String,
|
315
322
|
loc: T.nilable(Loc),
|
316
323
|
comments: T::Array[Comment],
|
317
|
-
block: T.nilable(T.proc.params(node: Const).void)
|
324
|
+
block: T.nilable(T.proc.params(node: Const).void),
|
318
325
|
).void
|
319
326
|
end
|
320
327
|
def initialize(name, value, loc: nil, comments: [], &block)
|
@@ -327,6 +334,7 @@ module RBI
|
|
327
334
|
sig { returns(String) }
|
328
335
|
def fully_qualified_name
|
329
336
|
return name if name.start_with?("::")
|
337
|
+
|
330
338
|
"#{parent_scope&.fully_qualified_name}::#{name}"
|
331
339
|
end
|
332
340
|
|
@@ -360,7 +368,7 @@ module RBI
|
|
360
368
|
visibility: Visibility,
|
361
369
|
sigs: T::Array[Sig],
|
362
370
|
loc: T.nilable(Loc),
|
363
|
-
comments: T::Array[Comment]
|
371
|
+
comments: T::Array[Comment],
|
364
372
|
).void
|
365
373
|
end
|
366
374
|
def initialize(name, names, visibility: Public.new, sigs: [], loc: nil, comments: [])
|
@@ -385,7 +393,7 @@ module RBI
|
|
385
393
|
sigs: T::Array[Sig],
|
386
394
|
loc: T.nilable(Loc),
|
387
395
|
comments: T::Array[Comment],
|
388
|
-
block: T.nilable(T.proc.params(node: AttrAccessor).void)
|
396
|
+
block: T.nilable(T.proc.params(node: AttrAccessor).void),
|
389
397
|
).void
|
390
398
|
end
|
391
399
|
def initialize(name, *names, visibility: Public.new, sigs: [], loc: nil, comments: [], &block)
|
@@ -417,7 +425,7 @@ module RBI
|
|
417
425
|
sigs: T::Array[Sig],
|
418
426
|
loc: T.nilable(Loc),
|
419
427
|
comments: T::Array[Comment],
|
420
|
-
block: T.nilable(T.proc.params(node: AttrReader).void)
|
428
|
+
block: T.nilable(T.proc.params(node: AttrReader).void),
|
421
429
|
).void
|
422
430
|
end
|
423
431
|
def initialize(name, *names, visibility: Public.new, sigs: [], loc: nil, comments: [], &block)
|
@@ -449,7 +457,7 @@ module RBI
|
|
449
457
|
sigs: T::Array[Sig],
|
450
458
|
loc: T.nilable(Loc),
|
451
459
|
comments: T::Array[Comment],
|
452
|
-
block: T.nilable(T.proc.params(node: AttrWriter).void)
|
460
|
+
block: T.nilable(T.proc.params(node: AttrWriter).void),
|
453
461
|
).void
|
454
462
|
end
|
455
463
|
def initialize(name, *names, visibility: Public.new, sigs: [], loc: nil, comments: [], &block)
|
@@ -499,7 +507,7 @@ module RBI
|
|
499
507
|
sigs: T::Array[Sig],
|
500
508
|
loc: T.nilable(Loc),
|
501
509
|
comments: T::Array[Comment],
|
502
|
-
block: T.nilable(T.proc.params(node: Method).void)
|
510
|
+
block: T.nilable(T.proc.params(node: Method).void),
|
503
511
|
).void
|
504
512
|
end
|
505
513
|
def initialize(
|
@@ -576,7 +584,7 @@ module RBI
|
|
576
584
|
name: String,
|
577
585
|
loc: T.nilable(Loc),
|
578
586
|
comments: T::Array[Comment],
|
579
|
-
block: T.nilable(T.proc.params(node: ReqParam).void)
|
587
|
+
block: T.nilable(T.proc.params(node: ReqParam).void),
|
580
588
|
).void
|
581
589
|
end
|
582
590
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -602,7 +610,7 @@ module RBI
|
|
602
610
|
value: String,
|
603
611
|
loc: T.nilable(Loc),
|
604
612
|
comments: T::Array[Comment],
|
605
|
-
block: T.nilable(T.proc.params(node: OptParam).void)
|
613
|
+
block: T.nilable(T.proc.params(node: OptParam).void),
|
606
614
|
).void
|
607
615
|
end
|
608
616
|
def initialize(name, value, loc: nil, comments: [], &block)
|
@@ -613,7 +621,7 @@ module RBI
|
|
613
621
|
|
614
622
|
sig { params(other: T.nilable(Object)).returns(T::Boolean) }
|
615
623
|
def ==(other)
|
616
|
-
OptParam === other && name == other.name
|
624
|
+
OptParam === other && name == other.name
|
617
625
|
end
|
618
626
|
end
|
619
627
|
|
@@ -625,7 +633,7 @@ module RBI
|
|
625
633
|
name: String,
|
626
634
|
loc: T.nilable(Loc),
|
627
635
|
comments: T::Array[Comment],
|
628
|
-
block: T.nilable(T.proc.params(node: RestParam).void)
|
636
|
+
block: T.nilable(T.proc.params(node: RestParam).void),
|
629
637
|
).void
|
630
638
|
end
|
631
639
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -652,7 +660,7 @@ module RBI
|
|
652
660
|
name: String,
|
653
661
|
loc: T.nilable(Loc),
|
654
662
|
comments: T::Array[Comment],
|
655
|
-
block: T.nilable(T.proc.params(node: KwParam).void)
|
663
|
+
block: T.nilable(T.proc.params(node: KwParam).void),
|
656
664
|
).void
|
657
665
|
end
|
658
666
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -683,7 +691,7 @@ module RBI
|
|
683
691
|
value: String,
|
684
692
|
loc: T.nilable(Loc),
|
685
693
|
comments: T::Array[Comment],
|
686
|
-
block: T.nilable(T.proc.params(node: KwOptParam).void)
|
694
|
+
block: T.nilable(T.proc.params(node: KwOptParam).void),
|
687
695
|
).void
|
688
696
|
end
|
689
697
|
def initialize(name, value, loc: nil, comments: [], &block)
|
@@ -699,7 +707,7 @@ module RBI
|
|
699
707
|
|
700
708
|
sig { params(other: T.nilable(Object)).returns(T::Boolean) }
|
701
709
|
def ==(other)
|
702
|
-
KwOptParam === other && name == other.name
|
710
|
+
KwOptParam === other && name == other.name
|
703
711
|
end
|
704
712
|
end
|
705
713
|
|
@@ -711,7 +719,7 @@ module RBI
|
|
711
719
|
name: String,
|
712
720
|
loc: T.nilable(Loc),
|
713
721
|
comments: T::Array[Comment],
|
714
|
-
block: T.nilable(T.proc.params(node: KwRestParam).void)
|
722
|
+
block: T.nilable(T.proc.params(node: KwRestParam).void),
|
715
723
|
).void
|
716
724
|
end
|
717
725
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -738,7 +746,7 @@ module RBI
|
|
738
746
|
name: String,
|
739
747
|
loc: T.nilable(Loc),
|
740
748
|
comments: T::Array[Comment],
|
741
|
-
block: T.nilable(T.proc.params(node: BlockParam).void)
|
749
|
+
block: T.nilable(T.proc.params(node: BlockParam).void),
|
742
750
|
).void
|
743
751
|
end
|
744
752
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -773,7 +781,7 @@ module RBI
|
|
773
781
|
name: String,
|
774
782
|
names: T::Array[String],
|
775
783
|
loc: T.nilable(Loc),
|
776
|
-
comments: T::Array[Comment]
|
784
|
+
comments: T::Array[Comment],
|
777
785
|
).void
|
778
786
|
end
|
779
787
|
def initialize(name, names, loc: nil, comments: [])
|
@@ -791,7 +799,7 @@ module RBI
|
|
791
799
|
names: String,
|
792
800
|
loc: T.nilable(Loc),
|
793
801
|
comments: T::Array[Comment],
|
794
|
-
block: T.nilable(T.proc.params(node: Include).void)
|
802
|
+
block: T.nilable(T.proc.params(node: Include).void),
|
795
803
|
).void
|
796
804
|
end
|
797
805
|
def initialize(name, *names, loc: nil, comments: [], &block)
|
@@ -814,7 +822,7 @@ module RBI
|
|
814
822
|
names: String,
|
815
823
|
loc: T.nilable(Loc),
|
816
824
|
comments: T::Array[Comment],
|
817
|
-
block: T.nilable(T.proc.params(node: Extend).void)
|
825
|
+
block: T.nilable(T.proc.params(node: Extend).void),
|
818
826
|
).void
|
819
827
|
end
|
820
828
|
def initialize(name, *names, loc: nil, comments: [], &block)
|
@@ -873,7 +881,7 @@ module RBI
|
|
873
881
|
params(
|
874
882
|
loc: T.nilable(Loc),
|
875
883
|
comments: T::Array[Comment],
|
876
|
-
block: T.nilable(T.proc.params(node: Public).void)
|
884
|
+
block: T.nilable(T.proc.params(node: Public).void),
|
877
885
|
).void
|
878
886
|
end
|
879
887
|
def initialize(loc: nil, comments: [], &block)
|
@@ -889,7 +897,7 @@ module RBI
|
|
889
897
|
params(
|
890
898
|
loc: T.nilable(Loc),
|
891
899
|
comments: T::Array[Comment],
|
892
|
-
block: T.nilable(T.proc.params(node: Protected).void)
|
900
|
+
block: T.nilable(T.proc.params(node: Protected).void),
|
893
901
|
).void
|
894
902
|
end
|
895
903
|
def initialize(loc: nil, comments: [], &block)
|
@@ -905,7 +913,7 @@ module RBI
|
|
905
913
|
params(
|
906
914
|
loc: T.nilable(Loc),
|
907
915
|
comments: T::Array[Comment],
|
908
|
-
block: T.nilable(T.proc.params(node: Private).void)
|
916
|
+
block: T.nilable(T.proc.params(node: Private).void),
|
909
917
|
).void
|
910
918
|
end
|
911
919
|
def initialize(loc: nil, comments: [], &block)
|
@@ -931,7 +939,7 @@ module RBI
|
|
931
939
|
args: T::Array[Arg],
|
932
940
|
loc: T.nilable(Loc),
|
933
941
|
comments: T::Array[Comment],
|
934
|
-
block: T.nilable(T.proc.params(node: Send).void)
|
942
|
+
block: T.nilable(T.proc.params(node: Send).void),
|
935
943
|
).void
|
936
944
|
end
|
937
945
|
def initialize(method, args = [], loc: nil, comments: [], &block)
|
@@ -966,7 +974,7 @@ module RBI
|
|
966
974
|
sig do
|
967
975
|
params(
|
968
976
|
value: String,
|
969
|
-
loc: T.nilable(Loc)
|
977
|
+
loc: T.nilable(Loc),
|
970
978
|
).void
|
971
979
|
end
|
972
980
|
def initialize(value, loc: nil)
|
@@ -995,7 +1003,7 @@ module RBI
|
|
995
1003
|
params(
|
996
1004
|
keyword: String,
|
997
1005
|
value: String,
|
998
|
-
loc: T.nilable(Loc)
|
1006
|
+
loc: T.nilable(Loc),
|
999
1007
|
).void
|
1000
1008
|
end
|
1001
1009
|
def initialize(keyword, value, loc: nil)
|
@@ -1045,7 +1053,7 @@ module RBI
|
|
1045
1053
|
type_params: T::Array[String],
|
1046
1054
|
checked: T.nilable(Symbol),
|
1047
1055
|
loc: T.nilable(Loc),
|
1048
|
-
block: T.nilable(T.proc.params(node: Sig).void)
|
1056
|
+
block: T.nilable(T.proc.params(node: Sig).void),
|
1049
1057
|
).void
|
1050
1058
|
end
|
1051
1059
|
def initialize(
|
@@ -1080,6 +1088,7 @@ module RBI
|
|
1080
1088
|
sig { params(other: Object).returns(T::Boolean) }
|
1081
1089
|
def ==(other)
|
1082
1090
|
return false unless other.is_a?(Sig)
|
1091
|
+
|
1083
1092
|
params == other.params && return_type == other.return_type && is_abstract == other.is_abstract &&
|
1084
1093
|
is_override == other.is_override && is_overridable == other.is_overridable && is_final == other.is_final &&
|
1085
1094
|
type_params == other.type_params && checked == other.checked
|
@@ -1098,7 +1107,7 @@ module RBI
|
|
1098
1107
|
type: String,
|
1099
1108
|
loc: T.nilable(Loc),
|
1100
1109
|
comments: T::Array[Comment],
|
1101
|
-
block: T.nilable(T.proc.params(node: SigParam).void)
|
1110
|
+
block: T.nilable(T.proc.params(node: SigParam).void),
|
1102
1111
|
).void
|
1103
1112
|
end
|
1104
1113
|
def initialize(name, type, loc: nil, comments: [], &block)
|
@@ -1124,7 +1133,7 @@ module RBI
|
|
1124
1133
|
name: String,
|
1125
1134
|
loc: T.nilable(Loc),
|
1126
1135
|
comments: T::Array[Comment],
|
1127
|
-
block: T.nilable(T.proc.params(klass: TStruct).void)
|
1136
|
+
block: T.nilable(T.proc.params(klass: TStruct).void),
|
1128
1137
|
).void
|
1129
1138
|
end
|
1130
1139
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -1151,7 +1160,7 @@ module RBI
|
|
1151
1160
|
type: String,
|
1152
1161
|
default: T.nilable(String),
|
1153
1162
|
loc: T.nilable(Loc),
|
1154
|
-
comments: T::Array[Comment]
|
1163
|
+
comments: T::Array[Comment],
|
1155
1164
|
).void
|
1156
1165
|
end
|
1157
1166
|
def initialize(name, type, default: nil, loc: nil, comments: [])
|
@@ -1175,7 +1184,7 @@ module RBI
|
|
1175
1184
|
default: T.nilable(String),
|
1176
1185
|
loc: T.nilable(Loc),
|
1177
1186
|
comments: T::Array[Comment],
|
1178
|
-
block: T.nilable(T.proc.params(node: TStructConst).void)
|
1187
|
+
block: T.nilable(T.proc.params(node: TStructConst).void),
|
1179
1188
|
).void
|
1180
1189
|
end
|
1181
1190
|
def initialize(name, type, default: nil, loc: nil, comments: [], &block)
|
@@ -1205,7 +1214,7 @@ module RBI
|
|
1205
1214
|
default: T.nilable(String),
|
1206
1215
|
loc: T.nilable(Loc),
|
1207
1216
|
comments: T::Array[Comment],
|
1208
|
-
block: T.nilable(T.proc.params(node: TStructProp).void)
|
1217
|
+
block: T.nilable(T.proc.params(node: TStructProp).void),
|
1209
1218
|
).void
|
1210
1219
|
end
|
1211
1220
|
def initialize(name, type, default: nil, loc: nil, comments: [], &block)
|
@@ -1235,7 +1244,7 @@ module RBI
|
|
1235
1244
|
name: String,
|
1236
1245
|
loc: T.nilable(Loc),
|
1237
1246
|
comments: T::Array[Comment],
|
1238
|
-
block: T.nilable(T.proc.params(klass: TEnum).void)
|
1247
|
+
block: T.nilable(T.proc.params(klass: TEnum).void),
|
1239
1248
|
).void
|
1240
1249
|
end
|
1241
1250
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -1255,7 +1264,7 @@ module RBI
|
|
1255
1264
|
names: T::Array[String],
|
1256
1265
|
loc: T.nilable(Loc),
|
1257
1266
|
comments: T::Array[Comment],
|
1258
|
-
block: T.nilable(T.proc.params(node: TEnumBlock).void)
|
1267
|
+
block: T.nilable(T.proc.params(node: TEnumBlock).void),
|
1259
1268
|
).void
|
1260
1269
|
end
|
1261
1270
|
def initialize(names = [], loc: nil, comments: [], &block)
|
@@ -1293,7 +1302,7 @@ module RBI
|
|
1293
1302
|
name: String,
|
1294
1303
|
loc: T.nilable(Loc),
|
1295
1304
|
comments: T::Array[Comment],
|
1296
|
-
block: T.nilable(T.proc.params(node: Helper).void)
|
1305
|
+
block: T.nilable(T.proc.params(node: Helper).void),
|
1297
1306
|
).void
|
1298
1307
|
end
|
1299
1308
|
def initialize(name, loc: nil, comments: [], &block)
|
@@ -1320,7 +1329,7 @@ module RBI
|
|
1320
1329
|
value: String,
|
1321
1330
|
loc: T.nilable(Loc),
|
1322
1331
|
comments: T::Array[Comment],
|
1323
|
-
block: T.nilable(T.proc.params(node: TypeMember).void)
|
1332
|
+
block: T.nilable(T.proc.params(node: TypeMember).void),
|
1324
1333
|
).void
|
1325
1334
|
end
|
1326
1335
|
def initialize(name, value, loc: nil, comments: [], &block)
|
@@ -1333,6 +1342,7 @@ module RBI
|
|
1333
1342
|
sig { returns(String) }
|
1334
1343
|
def fully_qualified_name
|
1335
1344
|
return name if name.start_with?("::")
|
1345
|
+
|
1336
1346
|
"#{parent_scope&.fully_qualified_name}::#{name}"
|
1337
1347
|
end
|
1338
1348
|
|
@@ -1351,7 +1361,7 @@ module RBI
|
|
1351
1361
|
names: String,
|
1352
1362
|
loc: T.nilable(Loc),
|
1353
1363
|
comments: T::Array[Comment],
|
1354
|
-
block: T.nilable(T.proc.params(node: MixesInClassMethods).void)
|
1364
|
+
block: T.nilable(T.proc.params(node: MixesInClassMethods).void),
|
1355
1365
|
).void
|
1356
1366
|
end
|
1357
1367
|
def initialize(name, *names, loc: nil, comments: [], &block)
|
@@ -1375,7 +1385,7 @@ module RBI
|
|
1375
1385
|
params(
|
1376
1386
|
name: String,
|
1377
1387
|
loc: T.nilable(Loc),
|
1378
|
-
comments: T::Array[Comment]
|
1388
|
+
comments: T::Array[Comment],
|
1379
1389
|
).void
|
1380
1390
|
end
|
1381
1391
|
def initialize(name, loc: nil, comments: [])
|