steep 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -3
  3. data/CHANGELOG.md +6 -0
  4. data/Rakefile +0 -13
  5. data/bin/setup +0 -2
  6. data/bin/smoke_runner.rb +0 -1
  7. data/exe/steep +0 -1
  8. data/lib/steep/project/file.rb +1 -1
  9. data/lib/steep/project/hover_content.rb +1 -1
  10. data/lib/steep/server/code_worker.rb +1 -1
  11. data/lib/steep/server/signature_worker.rb +4 -4
  12. data/lib/steep/type_construction.rb +10 -16
  13. data/lib/steep/type_inference/constant_env.rb +2 -10
  14. data/lib/steep/type_inference/context.rb +1 -0
  15. data/lib/steep/version.rb +1 -1
  16. data/steep.gemspec +1 -5
  17. metadata +17 -135
  18. data/exe/rbs +0 -3
  19. data/vendor/ruby-signature/.github/workflows/ruby.yml +0 -27
  20. data/vendor/ruby-signature/.gitignore +0 -12
  21. data/vendor/ruby-signature/.rubocop.yml +0 -15
  22. data/vendor/ruby-signature/BSDL +0 -22
  23. data/vendor/ruby-signature/COPYING +0 -56
  24. data/vendor/ruby-signature/Gemfile +0 -6
  25. data/vendor/ruby-signature/README.md +0 -93
  26. data/vendor/ruby-signature/Rakefile +0 -142
  27. data/vendor/ruby-signature/bin/annotate-with-rdoc +0 -157
  28. data/vendor/ruby-signature/bin/console +0 -14
  29. data/vendor/ruby-signature/bin/query-rdoc +0 -103
  30. data/vendor/ruby-signature/bin/setup +0 -10
  31. data/vendor/ruby-signature/bin/sort +0 -89
  32. data/vendor/ruby-signature/bin/test_runner.rb +0 -16
  33. data/vendor/ruby-signature/docs/CONTRIBUTING.md +0 -97
  34. data/vendor/ruby-signature/docs/sigs.md +0 -148
  35. data/vendor/ruby-signature/docs/stdlib.md +0 -152
  36. data/vendor/ruby-signature/docs/syntax.md +0 -528
  37. data/vendor/ruby-signature/exe/rbs +0 -7
  38. data/vendor/ruby-signature/lib/rbs.rb +0 -64
  39. data/vendor/ruby-signature/lib/rbs/ast/annotation.rb +0 -27
  40. data/vendor/ruby-signature/lib/rbs/ast/comment.rb +0 -27
  41. data/vendor/ruby-signature/lib/rbs/ast/declarations.rb +0 -395
  42. data/vendor/ruby-signature/lib/rbs/ast/members.rb +0 -362
  43. data/vendor/ruby-signature/lib/rbs/buffer.rb +0 -50
  44. data/vendor/ruby-signature/lib/rbs/builtin_names.rb +0 -55
  45. data/vendor/ruby-signature/lib/rbs/cli.rb +0 -558
  46. data/vendor/ruby-signature/lib/rbs/constant.rb +0 -26
  47. data/vendor/ruby-signature/lib/rbs/constant_table.rb +0 -150
  48. data/vendor/ruby-signature/lib/rbs/definition.rb +0 -170
  49. data/vendor/ruby-signature/lib/rbs/definition_builder.rb +0 -919
  50. data/vendor/ruby-signature/lib/rbs/environment.rb +0 -281
  51. data/vendor/ruby-signature/lib/rbs/environment_loader.rb +0 -136
  52. data/vendor/ruby-signature/lib/rbs/environment_walker.rb +0 -124
  53. data/vendor/ruby-signature/lib/rbs/errors.rb +0 -187
  54. data/vendor/ruby-signature/lib/rbs/location.rb +0 -102
  55. data/vendor/ruby-signature/lib/rbs/method_type.rb +0 -123
  56. data/vendor/ruby-signature/lib/rbs/namespace.rb +0 -91
  57. data/vendor/ruby-signature/lib/rbs/parser.y +0 -1344
  58. data/vendor/ruby-signature/lib/rbs/prototype/rb.rb +0 -553
  59. data/vendor/ruby-signature/lib/rbs/prototype/rbi.rb +0 -587
  60. data/vendor/ruby-signature/lib/rbs/prototype/runtime.rb +0 -381
  61. data/vendor/ruby-signature/lib/rbs/substitution.rb +0 -46
  62. data/vendor/ruby-signature/lib/rbs/test.rb +0 -26
  63. data/vendor/ruby-signature/lib/rbs/test/errors.rb +0 -61
  64. data/vendor/ruby-signature/lib/rbs/test/hook.rb +0 -294
  65. data/vendor/ruby-signature/lib/rbs/test/setup.rb +0 -58
  66. data/vendor/ruby-signature/lib/rbs/test/spy.rb +0 -325
  67. data/vendor/ruby-signature/lib/rbs/test/test_helper.rb +0 -183
  68. data/vendor/ruby-signature/lib/rbs/test/type_check.rb +0 -254
  69. data/vendor/ruby-signature/lib/rbs/type_name.rb +0 -70
  70. data/vendor/ruby-signature/lib/rbs/types.rb +0 -936
  71. data/vendor/ruby-signature/lib/rbs/variance_calculator.rb +0 -138
  72. data/vendor/ruby-signature/lib/rbs/vendorer.rb +0 -47
  73. data/vendor/ruby-signature/lib/rbs/version.rb +0 -3
  74. data/vendor/ruby-signature/lib/rbs/writer.rb +0 -269
  75. data/vendor/ruby-signature/lib/ruby/signature.rb +0 -7
  76. data/vendor/ruby-signature/rbs.gemspec +0 -46
  77. data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +0 -60
  78. data/vendor/ruby-signature/stdlib/base64/base64.rbs +0 -71
  79. data/vendor/ruby-signature/stdlib/benchmark/benchmark.rbs +0 -372
  80. data/vendor/ruby-signature/stdlib/builtin/array.rbs +0 -1997
  81. data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +0 -280
  82. data/vendor/ruby-signature/stdlib/builtin/binding.rbs +0 -177
  83. data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +0 -45
  84. data/vendor/ruby-signature/stdlib/builtin/class.rbs +0 -145
  85. data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +0 -116
  86. data/vendor/ruby-signature/stdlib/builtin/complex.rbs +0 -400
  87. data/vendor/ruby-signature/stdlib/builtin/constants.rbs +0 -37
  88. data/vendor/ruby-signature/stdlib/builtin/data.rbs +0 -5
  89. data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +0 -2
  90. data/vendor/ruby-signature/stdlib/builtin/dir.rbs +0 -413
  91. data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +0 -607
  92. data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +0 -404
  93. data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +0 -260
  94. data/vendor/ruby-signature/stdlib/builtin/errno.rbs +0 -781
  95. data/vendor/ruby-signature/stdlib/builtin/errors.rbs +0 -582
  96. data/vendor/ruby-signature/stdlib/builtin/exception.rbs +0 -194
  97. data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +0 -40
  98. data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +0 -68
  99. data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +0 -12
  100. data/vendor/ruby-signature/stdlib/builtin/file.rbs +0 -1076
  101. data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +0 -59
  102. data/vendor/ruby-signature/stdlib/builtin/float.rbs +0 -696
  103. data/vendor/ruby-signature/stdlib/builtin/gc.rbs +0 -243
  104. data/vendor/ruby-signature/stdlib/builtin/hash.rbs +0 -1029
  105. data/vendor/ruby-signature/stdlib/builtin/integer.rbs +0 -707
  106. data/vendor/ruby-signature/stdlib/builtin/io.rbs +0 -683
  107. data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +0 -576
  108. data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +0 -161
  109. data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +0 -271
  110. data/vendor/ruby-signature/stdlib/builtin/math.rbs +0 -369
  111. data/vendor/ruby-signature/stdlib/builtin/method.rbs +0 -185
  112. data/vendor/ruby-signature/stdlib/builtin/module.rbs +0 -1104
  113. data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +0 -82
  114. data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +0 -409
  115. data/vendor/ruby-signature/stdlib/builtin/object.rbs +0 -824
  116. data/vendor/ruby-signature/stdlib/builtin/proc.rbs +0 -429
  117. data/vendor/ruby-signature/stdlib/builtin/process.rbs +0 -1227
  118. data/vendor/ruby-signature/stdlib/builtin/random.rbs +0 -267
  119. data/vendor/ruby-signature/stdlib/builtin/range.rbs +0 -226
  120. data/vendor/ruby-signature/stdlib/builtin/rational.rbs +0 -424
  121. data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +0 -57
  122. data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +0 -1083
  123. data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +0 -14
  124. data/vendor/ruby-signature/stdlib/builtin/signal.rbs +0 -55
  125. data/vendor/ruby-signature/stdlib/builtin/string.rbs +0 -1901
  126. data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +0 -284
  127. data/vendor/ruby-signature/stdlib/builtin/struct.rbs +0 -40
  128. data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +0 -228
  129. data/vendor/ruby-signature/stdlib/builtin/thread.rbs +0 -1108
  130. data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +0 -23
  131. data/vendor/ruby-signature/stdlib/builtin/time.rbs +0 -1047
  132. data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +0 -290
  133. data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +0 -46
  134. data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +0 -153
  135. data/vendor/ruby-signature/stdlib/builtin/warning.rbs +0 -17
  136. data/vendor/ruby-signature/stdlib/coverage/coverage.rbs +0 -62
  137. data/vendor/ruby-signature/stdlib/csv/csv.rbs +0 -773
  138. data/vendor/ruby-signature/stdlib/erb/erb.rbs +0 -392
  139. data/vendor/ruby-signature/stdlib/find/find.rbs +0 -40
  140. data/vendor/ruby-signature/stdlib/ipaddr/ipaddr.rbs +0 -247
  141. data/vendor/ruby-signature/stdlib/json/json.rbs +0 -335
  142. data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +0 -1093
  143. data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +0 -23
  144. data/vendor/ruby-signature/stdlib/prime/prime.rbs +0 -188
  145. data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +0 -9
  146. data/vendor/ruby-signature/stdlib/set/set.rbs +0 -301
  147. data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +0 -53
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $LOAD_PATH << File.join(__dir__, "../lib")
4
- require "rbs"
5
- require "rbs/cli"
6
-
7
- RBS::CLI.new(stdout: STDOUT, stderr: STDERR).run(ARGV.dup)
@@ -1,64 +0,0 @@
1
- require "rbs/version"
2
-
3
- require "set"
4
- require "json"
5
- require "pathname"
6
- require "pp"
7
- require "ripper"
8
- require "logger"
9
- require "tsort"
10
-
11
- require "rbs/errors"
12
- require "rbs/buffer"
13
- require "rbs/location"
14
- require "rbs/namespace"
15
- require "rbs/type_name"
16
- require "rbs/types"
17
- require "rbs/method_type"
18
- require "rbs/ast/declarations"
19
- require "rbs/ast/members"
20
- require "rbs/ast/annotation"
21
- require "rbs/environment"
22
- require "rbs/environment_loader"
23
- require "rbs/builtin_names"
24
- require "rbs/definition"
25
- require "rbs/definition_builder"
26
- require "rbs/variance_calculator"
27
- require "rbs/substitution"
28
- require "rbs/constant"
29
- require "rbs/constant_table"
30
- require "rbs/ast/comment"
31
- require "rbs/writer"
32
- require "rbs/prototype/rbi"
33
- require "rbs/prototype/rb"
34
- require "rbs/prototype/runtime"
35
- require "rbs/environment_walker"
36
- require "rbs/vendorer"
37
-
38
- begin
39
- require "rbs/parser"
40
- rescue LoadError
41
- STDERR.puts "Missing parser Ruby code? Running `rake parser` may solve the issue"
42
- raise
43
- end
44
-
45
- module RBS
46
- class <<self
47
- attr_reader :logger_level
48
- attr_reader :logger_output
49
-
50
- def logger
51
- @logger ||= Logger.new(logger_output || STDERR, level: logger_level || "warn", progname: "rbs")
52
- end
53
-
54
- def logger_output=(val)
55
- @logger_output = val
56
- @logger = nil
57
- end
58
-
59
- def logger_level=(level)
60
- @logger_level = level
61
- @logger = nil
62
- end
63
- end
64
- end
@@ -1,27 +0,0 @@
1
- module RBS
2
- module AST
3
- class Annotation
4
- attr_reader :string
5
- attr_reader :location
6
-
7
- def initialize(string:, location:)
8
- @string = string
9
- @location = location
10
- end
11
-
12
- def ==(other)
13
- other.is_a?(Annotation) && other.string == string
14
- end
15
-
16
- alias eql? ==
17
-
18
- def hash
19
- self.class.hash ^ string.hash
20
- end
21
-
22
- def to_json(*a)
23
- { string: string, location: location }.to_json(*a)
24
- end
25
- end
26
- end
27
- end
@@ -1,27 +0,0 @@
1
- module RBS
2
- module AST
3
- class Comment
4
- attr_reader :string
5
- attr_reader :location
6
-
7
- def initialize(string:, location:)
8
- @string = string
9
- @location = location
10
- end
11
-
12
- def ==(other)
13
- other.is_a?(Comment) && other.string == string
14
- end
15
-
16
- alias eql? ==
17
-
18
- def hash
19
- self.class.hash ^ string.hash
20
- end
21
-
22
- def to_json(*a)
23
- { string: string, location: location }.to_json(*a)
24
- end
25
- end
26
- end
27
- end
@@ -1,395 +0,0 @@
1
- module RBS
2
- module AST
3
- module Declarations
4
- class ModuleTypeParams
5
- attr_reader :params
6
-
7
- TypeParam = Struct.new(:name, :variance, :skip_validation, keyword_init: true)
8
-
9
- def initialize()
10
- @params = []
11
- end
12
-
13
- def add(param)
14
- params << param
15
- self
16
- end
17
-
18
- def ==(other)
19
- other.is_a?(ModuleTypeParams) && other.params == params
20
- end
21
-
22
- alias eql? ==
23
-
24
- def hash
25
- params.hash
26
- end
27
-
28
- def [](name)
29
- params.find {|p| p.name == name }
30
- end
31
-
32
- def to_json(*a)
33
- {
34
- params: params
35
- }.to_json(*a)
36
- end
37
-
38
- def each(&block)
39
- params.each(&block)
40
- end
41
-
42
- def self.empty
43
- new
44
- end
45
-
46
- def variance(name)
47
- self[name].variance
48
- end
49
-
50
- def skip_validation?(name)
51
- self[name].skip_validation
52
- end
53
-
54
- def empty?
55
- params.empty?
56
- end
57
-
58
- def size
59
- params.size
60
- end
61
-
62
- def rename_to(names)
63
- ModuleTypeParams.new().tap do |params|
64
- names.each.with_index do |new_name, index|
65
- param = self.params[index]
66
- params.add(TypeParam.new(name: new_name, variance: param.variance, skip_validation: param.skip_validation))
67
- end
68
- end
69
- end
70
- end
71
-
72
- class Class
73
- class Super
74
- attr_reader :name
75
- attr_reader :args
76
-
77
- def initialize(name:, args:)
78
- @name = name
79
- @args = args
80
- end
81
-
82
- def ==(other)
83
- other.is_a?(Super) && other.name == name && other.args == args
84
- end
85
-
86
- alias eql? ==
87
-
88
- def hash
89
- self.class.hash ^ name.hash ^ args.hash
90
- end
91
-
92
- def to_json(*a)
93
- {
94
- name: name,
95
- args: args
96
- }.to_json(*a)
97
- end
98
- end
99
-
100
- attr_reader :name
101
- attr_reader :type_params
102
- attr_reader :members
103
- attr_reader :super_class
104
- attr_reader :annotations
105
- attr_reader :location
106
- attr_reader :comment
107
-
108
- def initialize(name:, type_params:, super_class:, members:, annotations:, location:, comment:)
109
- @name = name
110
- @type_params = type_params
111
- @super_class = super_class
112
- @members = members
113
- @annotations = annotations
114
- @location = location
115
- @comment = comment
116
- end
117
-
118
- def ==(other)
119
- other.is_a?(Class) &&
120
- other.name == name &&
121
- other.type_params == type_params &&
122
- other.super_class == super_class &&
123
- other.members == members
124
- end
125
-
126
- alias eql? ==
127
-
128
- def hash
129
- self.class.hash ^ name.hash ^ type_params.hash ^ super_class.hash ^ members.hash
130
- end
131
-
132
- def to_json(*a)
133
- {
134
- declaration: :class,
135
- name: name,
136
- type_params: type_params,
137
- members: members,
138
- super_class: super_class,
139
- annotations: annotations,
140
- location: location,
141
- comment: comment
142
- }.to_json(*a)
143
- end
144
- end
145
-
146
- class Module
147
- attr_reader :name
148
- attr_reader :type_params
149
- attr_reader :members
150
- attr_reader :location
151
- attr_reader :annotations
152
- attr_reader :self_type
153
- attr_reader :comment
154
-
155
- def initialize(name:, type_params:, members:, self_type:, annotations:, location:, comment:)
156
- @name = name
157
- @type_params = type_params
158
- @self_type = self_type
159
- @members = members
160
- @annotations = annotations
161
- @location = location
162
- @comment = comment
163
- end
164
-
165
- def ==(other)
166
- other.is_a?(Module) &&
167
- other.name == name &&
168
- other.type_params == type_params &&
169
- other.self_type == self_type &&
170
- other.members == members
171
- end
172
-
173
- alias eql? ==
174
-
175
- def hash
176
- self.class.hash ^ name.hash ^ type_params.hash ^ self_type.hash ^ members.hash
177
- end
178
-
179
- def to_json(*a)
180
- {
181
- declaration: :module,
182
- name: name,
183
- type_params: type_params,
184
- members: members,
185
- self_type: self_type,
186
- annotations: annotations,
187
- location: location,
188
- comment: comment
189
- }.to_json(*a)
190
- end
191
- end
192
-
193
- class Extension
194
- attr_reader :name
195
- attr_reader :type_params
196
- attr_reader :extension_name
197
- attr_reader :members
198
- attr_reader :annotations
199
- attr_reader :location
200
- attr_reader :comment
201
-
202
- def initialize(name:, type_params:, extension_name:, members:, annotations:, location:, comment:)
203
- @name = name
204
- @type_params = type_params
205
- @extension_name = extension_name
206
- @members = members
207
- @annotations = annotations
208
- @location = location
209
- @comment = comment
210
- end
211
-
212
- def ==(other)
213
- other.is_a?(Extension) &&
214
- other.name == name &&
215
- other.type_params == type_params &&
216
- other.extension_name == extension_name &&
217
- other.members == members
218
- end
219
-
220
- alias eql? ==
221
-
222
- def hash
223
- self.class.hash ^ name.hash ^ type_params.hash ^ extension_name.hash ^ members.hash
224
- end
225
-
226
- def to_json(*a)
227
- {
228
- declaration: :extension,
229
- name: name,
230
- type_params: type_params,
231
- extension_name: extension_name,
232
- members: members,
233
- annotations: annotations,
234
- location: location,
235
- comment: comment
236
- }.to_json(*a)
237
- end
238
- end
239
-
240
- class Interface
241
- attr_reader :name
242
- attr_reader :type_params
243
- attr_reader :members
244
- attr_reader :annotations
245
- attr_reader :location
246
- attr_reader :comment
247
-
248
- def initialize(name:, type_params:, members:, annotations:, location:, comment:)
249
- @name = name
250
- @type_params = type_params
251
- @members = members
252
- @annotations = annotations
253
- @location = location
254
- @comment = comment
255
- end
256
-
257
- def ==(other)
258
- other.is_a?(Interface) &&
259
- other.name == name &&
260
- other.type_params == type_params &&
261
- other.members == members
262
- end
263
-
264
- alias eql? ==
265
-
266
- def hash
267
- self.class.hash ^ type_params.hash ^ members.hash
268
- end
269
-
270
- def to_json(*a)
271
- {
272
- declaration: :interface,
273
- name: name,
274
- type_params: type_params,
275
- members: members,
276
- annotations: annotations,
277
- location: location,
278
- comment: comment
279
- }.to_json(*a)
280
- end
281
- end
282
-
283
- class Alias
284
- attr_reader :name
285
- attr_reader :type
286
- attr_reader :annotations
287
- attr_reader :location
288
- attr_reader :comment
289
-
290
- def initialize(name:, type:, annotations:, location:, comment:)
291
- @name = name
292
- @type = type
293
- @annotations = annotations
294
- @location = location
295
- @comment = comment
296
- end
297
-
298
- def ==(other)
299
- other.is_a?(Alias) &&
300
- other.name == name &&
301
- other.type == type
302
- end
303
-
304
- alias eql? ==
305
-
306
- def hash
307
- self.class.hash ^ name.hash ^ type.hash
308
- end
309
-
310
- def to_json(*a)
311
- {
312
- declaration: :alias,
313
- name: name,
314
- type: type,
315
- annotations: annotations,
316
- location: location,
317
- comment: comment
318
- }.to_json(*a)
319
- end
320
- end
321
-
322
- class Constant
323
- attr_reader :name
324
- attr_reader :type
325
- attr_reader :location
326
- attr_reader :comment
327
-
328
- def initialize(name:, type:, location:, comment:)
329
- @name = name
330
- @type = type
331
- @location = location
332
- @comment = comment
333
- end
334
-
335
- def ==(other)
336
- other.is_a?(Constant) &&
337
- other.name == name &&
338
- other.type == type
339
- end
340
-
341
- alias eql? ==
342
-
343
- def hash
344
- self.class.hash ^ name.hash ^ type.hash
345
- end
346
-
347
- def to_json(*a)
348
- {
349
- declaration: :constant,
350
- name: name,
351
- type: type,
352
- location: location,
353
- comment: comment
354
- }.to_json(*a)
355
- end
356
- end
357
-
358
- class Global
359
- attr_reader :name
360
- attr_reader :type
361
- attr_reader :location
362
- attr_reader :comment
363
-
364
- def initialize(name:, type:, location:, comment:)
365
- @name = name
366
- @type = type
367
- @location = location
368
- @comment = comment
369
- end
370
-
371
- def ==(other)
372
- other.is_a?(Global) &&
373
- other.name == name &&
374
- other.type == type
375
- end
376
-
377
- alias eql? ==
378
-
379
- def hash
380
- self.class.hash ^ name.hash ^ type.hash
381
- end
382
-
383
- def to_json(*a)
384
- {
385
- declaration: :global,
386
- name: name,
387
- type: type,
388
- location: location,
389
- comment: comment
390
- }.to_json(*a)
391
- end
392
- end
393
- end
394
- end
395
- end