rbs 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +10 -10
  3. data/.gitignore +0 -1
  4. data/CHANGELOG.md +24 -0
  5. data/Gemfile +3 -0
  6. data/README.md +8 -2
  7. data/Rakefile +9 -4
  8. data/Steepfile +1 -0
  9. data/bin/annotate-with-rdoc +1 -1
  10. data/bin/setup +0 -2
  11. data/bin/test_runner.rb +3 -6
  12. data/docs/CONTRIBUTING.md +1 -0
  13. data/goodcheck.yml +22 -5
  14. data/lib/rbs/ast/comment.rb +1 -1
  15. data/lib/rbs/cli.rb +12 -4
  16. data/lib/rbs/constant.rb +1 -1
  17. data/lib/rbs/constant_table.rb +9 -8
  18. data/lib/rbs/definition_builder.rb +4 -5
  19. data/lib/rbs/environment.rb +5 -1
  20. data/lib/rbs/environment_loader.rb +12 -12
  21. data/lib/rbs/namespace.rb +1 -1
  22. data/lib/rbs/parser.rb +3146 -0
  23. data/lib/rbs/parser.y +7 -2
  24. data/lib/rbs/test/setup_helper.rb +4 -4
  25. data/lib/rbs/test/type_check.rb +2 -2
  26. data/lib/rbs/type_name.rb +1 -1
  27. data/lib/rbs/variance_calculator.rb +2 -2
  28. data/lib/rbs/version.rb +1 -1
  29. data/lib/rbs/writer.rb +25 -15
  30. data/sig/constant.rbs +21 -0
  31. data/sig/constant_table.rbs +30 -0
  32. data/sig/declarations.rbs +1 -1
  33. data/sig/definition.rbs +1 -1
  34. data/sig/definition_builder.rbs +4 -5
  35. data/sig/environment_loader.rbs +54 -0
  36. data/sig/namespace.rbs +3 -3
  37. data/sig/parser.rbs +25 -0
  38. data/sig/substitution.rbs +3 -3
  39. data/sig/typename.rbs +1 -1
  40. data/sig/types.rbs +1 -1
  41. data/sig/version.rbs +3 -0
  42. data/sig/writer.rbs +40 -0
  43. data/stdlib/benchmark/benchmark.rbs +2 -2
  44. data/stdlib/builtin/basic_object.rbs +54 -54
  45. data/stdlib/builtin/binding.rbs +42 -42
  46. data/stdlib/builtin/class.rbs +33 -33
  47. data/stdlib/builtin/complex.rbs +90 -90
  48. data/stdlib/builtin/encoding.rbs +33 -33
  49. data/stdlib/builtin/enumerable.rbs +32 -32
  50. data/stdlib/builtin/enumerator.rbs +35 -35
  51. data/stdlib/builtin/errors.rbs +1 -1
  52. data/stdlib/builtin/exception.rbs +50 -50
  53. data/stdlib/builtin/false_class.rbs +6 -6
  54. data/stdlib/builtin/fiber.rbs +14 -14
  55. data/stdlib/builtin/fiber_error.rbs +1 -1
  56. data/stdlib/builtin/float.rbs +161 -161
  57. data/stdlib/builtin/gc.rbs +1 -1
  58. data/stdlib/builtin/io.rbs +83 -83
  59. data/stdlib/builtin/kernel.rbs +70 -68
  60. data/stdlib/builtin/match_data.rbs +1 -1
  61. data/stdlib/builtin/method.rbs +19 -19
  62. data/stdlib/builtin/nil_class.rbs +20 -20
  63. data/stdlib/builtin/numeric.rbs +101 -101
  64. data/stdlib/builtin/object.rbs +172 -172
  65. data/stdlib/builtin/proc.rbs +91 -91
  66. data/stdlib/builtin/range.rbs +2 -4
  67. data/stdlib/builtin/rational.rbs +83 -83
  68. data/stdlib/builtin/signal.rbs +7 -7
  69. data/stdlib/builtin/string.rbs +4 -4
  70. data/stdlib/builtin/string_io.rbs +1 -1
  71. data/stdlib/builtin/thread.rbs +185 -185
  72. data/stdlib/builtin/thread_group.rbs +2 -2
  73. data/stdlib/builtin/true_class.rbs +9 -9
  74. data/stdlib/builtin/warning.rbs +1 -1
  75. data/stdlib/date/date.rbs +2 -2
  76. data/stdlib/find/find.rbs +10 -10
  77. data/stdlib/pathname/pathname.rbs +2 -0
  78. data/stdlib/pty/pty.rbs +5 -29
  79. data/stdlib/tmpdir/tmpdir.rbs +12 -12
  80. data/stdlib/uri/generic.rbs +1 -1
  81. data/stdlib/uri/http.rbs +158 -0
  82. data/stdlib/uri/https.rbs +108 -0
  83. data/stdlib/uri/ldap.rbs +224 -0
  84. data/stdlib/uri/ldaps.rbs +108 -0
  85. data/steep/Gemfile.lock +13 -17
  86. metadata +12 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db07b9abb1ed59e789d6a13145e33503f20e37a908826c3c8ba8222f9cf79ec6
4
- data.tar.gz: a42440c8542489fd70f24139f24e718b106caa99925a437857867141f730ed9a
3
+ metadata.gz: 391c185c91da1e233ce83cf4c9cd37f3624bfef9fbb96aa636bf9b42348bd62a
4
+ data.tar.gz: 21163b54afaf9e6d5a4b7638e29433511bbb3b26c62892ca4a22053d64675baa
5
5
  SHA512:
6
- metadata.gz: 606289f49ac2d2934808add204997b7828708b05f2b3d60c10f8de6106cbca06527fd628de445511dfa537976fab551e878a45b5ab03ac41374cf242f90b6244
7
- data.tar.gz: 5de0b5b93fd872a69fe25d62eaf72fba3fc4d93b57f04f5da311fc66d3b6eeebe53fb654cea4361da32124861ac21c1ad9547bf9e7c0012b6db704e98164a8d9
6
+ metadata.gz: 19aa7220827ebae3cbc653622a1041d3a65b463edacd045800d5247e2a3e30cd30cfcd5ce9296abeb03232a0497693803ed84c3e910cd9c62d104a0f59097043
7
+ data.tar.gz: 8eebfa6339124dc466c23a75fe6b1a90728ce916e8eab4dd8d7442055d2d2bf22fafb696ace169202b6a15888e1a059ac2f6dca25db3953e75b6e88f2b729934
@@ -12,23 +12,23 @@ jobs:
12
12
  strategy:
13
13
  matrix:
14
14
  container_tag:
15
- - master-nightly-bionic
15
+ - master-nightly-bionic
16
16
  - 2.6.5-bionic
17
17
  - 2.7.0-bionic
18
+ job:
19
+ - test
20
+ - stdlib_test
21
+ - rubocop validate test_doc build test_generate_stdlib
18
22
  container:
19
23
  image: rubylang/ruby:${{ matrix.container_tag }}
20
24
  steps:
21
25
  - uses: actions/checkout@v1
22
- - name: Run test
26
+ - name: Install
23
27
  run: |
24
28
  ruby -v
25
29
  gem install bundler
26
30
  bin/setup
27
- bundle exec rake test
28
- bundle exec rake stdlib_test
29
- bundle exec rake rubocop
30
- bundle exec rake validate
31
- bundle exec rake test_doc
32
- bundle exec rake build
33
- RBS_GENERATE_TEST_PATH=/tmp/Array_test.rb bundle exec rake 'generate:stdlib_test[Array]'
34
- ruby -c /tmp/Array_test.rb
31
+ - name: Run test
32
+ run: |
33
+ bundle exec rake ${{ matrix.job }}
34
+ if: "!(matrix.job == 'stdlib_test' && contains(matrix.container_tag, '2.6.5'))"
data/.gitignore CHANGED
@@ -6,7 +6,6 @@
6
6
  /spec/reports/
7
7
  /tmp/
8
8
  /.ruby-version
9
- /lib/rbs/parser.rb
10
9
  /lib/rbs/parser.output
11
10
  /vendor/sigs
12
11
  /Gemfile.lock
@@ -2,6 +2,30 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.14.0 (2020-10-17)
6
+
7
+ * Allow keyword names ending with `?` and `!` ([#417](https://github.com/ruby/rbs/pull/417))
8
+ * Make `Range[T]` covariant ([#418](https://github.com/ruby/rbs/pull/418))
9
+
10
+ ## 0.13.1 (2020-10-09)
11
+
12
+ * Fix test for CI of ruby/ruby ([#412](https://github.com/ruby/rbs/pull/412))
13
+
14
+ ## 0.13.0 (2020-10-09)
15
+
16
+ * Signature updates for `URI` classes.
17
+ * Fix tests ([#410](https://github.com/ruby/rbs/pull/410))
18
+ * Add `--silent` option for `rbs validate` ([#411](https://github.com/ruby/rbs/pull/411))
19
+
20
+ ## 0.12.2 (2020-09-17)
21
+
22
+ * Minor signature update for `pty`
23
+ * Fix `PTY` stdlib test
24
+
25
+ ## 0.12.1 (2020-09-16)
26
+
27
+ This version is to improve Ruby 3 testing compatibility. Nothing changed for users.
28
+
5
29
  ## 0.12.0 (2020-09-15)
6
30
 
7
31
  * Signature updates for `forwardable`, `struct`, `set`, `URI::Generic`, `URI::File`, and `BigDecimal`.
data/Gemfile CHANGED
@@ -19,3 +19,6 @@ gem "goodcheck"
19
19
  # Test gems
20
20
  gem "rbs-amber", path: "test/assets/test-gem"
21
21
 
22
+ group :ide, optional: true do
23
+ gem "ruby-debug-ide"
24
+ end
data/README.md CHANGED
@@ -74,7 +74,7 @@ $ rbs method Object then
74
74
 
75
75
  ## Library
76
76
 
77
- There are two important concepts, _environment_ and _definition_.
77
+ There are two important concepts, _environment_ and _definition_.
78
78
 
79
79
  An _environment_ is a dictionary that keeps track of all declarations. What is the declaration associated with `String` class? An _environment_ will give you the answer.
80
80
 
@@ -104,8 +104,14 @@ builder = RBS::DefinitionBuilder.new(env: environment)
104
104
 
105
105
  # Definition of instance of String
106
106
  instance = builder.build_instance(string)
107
- # Print the types of `gsub` method
107
+
108
+ # Print the types of `gsub` method:
108
109
  puts instance.methods[:gsub].method_types.join("\n")
110
+ # Ouputs =>
111
+ # (::Regexp | ::string pattern, ::string replacement) -> ::String
112
+ # (::Regexp | ::string pattern, ::Hash[::String, ::String] hash) -> ::String
113
+ # (::Regexp | ::string pattern) { (::String match) -> ::_ToS } -> ::String
114
+ # (::Regexp | ::string pattern) -> ::Enumerator[::String, self]
109
115
 
110
116
  # Definition of singleton of String
111
117
  singleton = builder.build_singleton(string)
data/Rakefile CHANGED
@@ -25,19 +25,19 @@ task :test_doc => :parser do
25
25
  end
26
26
 
27
27
  task :validate => :parser do
28
- sh "#{ruby} #{rbs} validate"
28
+ sh "#{ruby} #{rbs} validate --silent"
29
29
 
30
30
  FileList["stdlib/*"].each do |path|
31
31
  next if path =~ %r{stdlib/builtin}
32
- sh "#{ruby} #{rbs} -r#{File.basename(path)} validate"
32
+ sh "#{ruby} #{rbs} -r#{File.basename(path)} validate --silent"
33
33
  end
34
34
  end
35
35
 
36
36
  FileList["test/stdlib/**/*_test.rb"].each do |test|
37
- multitask test => :parser do
37
+ task test => :parser do
38
38
  sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test}"
39
39
  end
40
- multitask stdlib_test: test
40
+ task stdlib_test: test
41
41
  end
42
42
 
43
43
  task :rubocop do
@@ -176,4 +176,9 @@ namespace :generate do
176
176
  end
177
177
  end
178
178
 
179
+ task :test_generate_stdlib do
180
+ sh "RBS_GENERATE_TEST_PATH=/tmp/Array_test.rb rake 'generate:stdlib_test[Array]'"
181
+ sh "ruby -c /tmp/Array_test.rb"
182
+ end
183
+
179
184
  CLEAN.include("lib/rbs/parser.rb")
data/Steepfile CHANGED
@@ -1,6 +1,7 @@
1
1
  target :lib do
2
2
  signature "sig"
3
3
  check "lib"
4
+ ignore "lib/rbs/parser.rb"
4
5
 
5
6
  vendor stdlib: "stdlib"
6
7
  library "set", "pathname", "json", "logger"
@@ -14,7 +14,7 @@ def format_comment(comment)
14
14
  out = RDoc::Markup::Document.new
15
15
  out << comment
16
16
  formatter = RDoc::Markup::ToMarkdown.new
17
- out.accept(formatter)
17
+ out.accept(formatter).lines.map(&:rstrip).join("\n")
18
18
  end
19
19
 
20
20
  def comment_for_constant(decl, stores:)
data/bin/setup CHANGED
@@ -6,5 +6,3 @@ set -vx
6
6
  bundle install --jobs 4 --retry 3
7
7
 
8
8
  # Do any other automated setup that you need to do here
9
-
10
- bundle exec rake parser
@@ -2,16 +2,13 @@
2
2
 
3
3
  $LOAD_PATH << File.join(__dir__, "../lib")
4
4
 
5
- STDLIB_TEST = Gem::Version.new(RUBY_VERSION).yield_self do |ruby_version|
5
+ IS_RUBY_27 = Gem::Version.new(RUBY_VERSION).yield_self do |ruby_version|
6
6
  Gem::Version.new('2.7.0') <= ruby_version &&
7
7
  ruby_version <= Gem::Version.new('2.8.0')
8
8
  end
9
9
 
10
- unless STDLIB_TEST
11
- unless ENV["FORCE_STDLIB_TEST"]
12
- STDERR.puts "🚨🚨🚨 stdlib test requires Ruby 2.7 or later but RUBY_VERSION==#{RUBY_VERSION}, exiting... 🚨🚨🚨"
13
- exit
14
- end
10
+ unless IS_RUBY_27
11
+ STDERR.puts "⚠️⚠️⚠️⚠️ stdlib test assumes Ruby 2.7 but RUBY_VERSION==#{RUBY_VERSION} ⚠️⚠️⚠️⚠️"
15
12
  end
16
13
 
17
14
  ARGV.each do |arg|
@@ -17,6 +17,7 @@
17
17
  - Use `rbs prototype runtime --merge CLASS_NAME` command to generate the missing method definitions.
18
18
  - Committing the auto generated signatures is recommended.
19
19
  5. Annotate with RDoc.
20
+ - You'll need RDoc installed. Rvm users should use `rvm docs generate` first.
20
21
  - Use `bin/annotate-with-rdoc stdlib/path/to/signature.rbs` to annotate the RBS files.
21
22
  - Committing the generated annotations is recommended.
22
23
  6. Fix method types and comments.
@@ -6,12 +6,12 @@ rules:
6
6
  - "stdlib/**/*.rbs"
7
7
  fail:
8
8
  - |
9
- # arglists 💪👽🚨 << Delete this section
10
- # File.absolute_path?(file_name) -> true or false
9
+ # arglists 💪👽🚨 << Delete this section
10
+ # File.absolute_path?(file_name) -> true or false
11
11
  #
12
12
 
13
13
  - id: rbs.no_arg
14
- pattern:
14
+ pattern:
15
15
  regexp: arg\d+
16
16
  message: |
17
17
  Stop using parameter names like `arg0` or `arg1`
@@ -23,7 +23,7 @@ rules:
23
23
  - Documents (comments) may contain that pattern.
24
24
  glob:
25
25
  - "stdlib/**/*.rbs"
26
- fail:
26
+ fail:
27
27
  - "def `send`: (String | Symbol arg0, *untyped arg1) -> untyped"
28
28
  pass:
29
29
  - "def `send`: (String | Symbol, *untyped) -> untyped"
@@ -62,4 +62,21 @@ rules:
62
62
  end
63
63
  end
64
64
 
65
-
65
+ - id: no_trailing_whitespace
66
+ pattern:
67
+ regexp: '[ \t]+$'
68
+ message: |
69
+ Trim trailing whitespaces
70
+ glob:
71
+ - '**/*.rb'
72
+ - '**/*.rbs'
73
+ - '**/*.md'
74
+ justification:
75
+ - Let the maintainers know if it is an autogenerated files.
76
+ pass:
77
+ - "Hello world"
78
+ - "Hello\nworld"
79
+ - "Hello\n\nworld"
80
+ fail:
81
+ - "Hello world "
82
+ - "Hello \nworld"
@@ -23,7 +23,7 @@ module RBS
23
23
  { string: string, location: location }.to_json(*a)
24
24
  end
25
25
 
26
- def concat(string:, location:)
26
+ def concat(string:, location:)
27
27
  @string.concat string
28
28
 
29
29
  if loc = @location
@@ -1,3 +1,4 @@
1
+ require "open3"
1
2
  require "optparse"
2
3
  require "shellwords"
3
4
 
@@ -383,6 +384,11 @@ Examples:
383
384
 
384
385
  $ rbs validate
385
386
  EOU
387
+
388
+ opts.on("--silent") do
389
+ require "stringio"
390
+ @stdout = StringIO.new
391
+ end
386
392
  end.parse!(args)
387
393
 
388
394
  loader = EnvironmentLoader.new()
@@ -488,7 +494,7 @@ Show paths to directories where the RBS files are loaded from.
488
494
  Examples:
489
495
 
490
496
  $ rbs paths
491
- $ tbs -r set paths
497
+ $ rbs -r set paths
492
498
  EOU
493
499
  end.parse!(args)
494
500
 
@@ -543,7 +549,7 @@ EOU
543
549
  Usage: rbs prototype runtime [options...] [pattern...]
544
550
 
545
551
  Generate RBS prototype based on runtime introspection.
546
- It loads Ruby code specified in [options] and generates RBS prototypes for classes matches to [pattern].
552
+ It loads Ruby code specified in [options] and generates RBS prototypes for classes matches to [pattern].
547
553
 
548
554
  Examples:
549
555
 
@@ -808,8 +814,10 @@ EOB
808
814
  'RBS_TEST_TARGET' => (targets.join(',') unless targets.empty?)
809
815
  }
810
816
 
811
- system(env_hash, *args)
812
- $?
817
+ out, err, status = Open3.capture3(env_hash, *args)
818
+ stdout.print(out)
819
+ stderr.print(err)
820
+ status
813
821
  end
814
822
  end
815
823
  end
@@ -2,7 +2,7 @@ module RBS
2
2
  class Constant
3
3
  attr_reader :name
4
4
  attr_reader :type
5
- attr_reader :declaration
5
+ attr_reader :entry
6
6
 
7
7
  def initialize(name:, type:, entry:)
8
8
  @name = name
@@ -47,6 +47,8 @@ module RBS
47
47
 
48
48
  head, *tail = split_name(name)
49
49
 
50
+ raise unless head
51
+
50
52
  head_constant = case
51
53
  when name.absolute?
52
54
  name_to_constant(TypeName.new(name: head, namespace: Namespace.root))
@@ -57,11 +59,13 @@ module RBS
57
59
  resolve_constant_reference_inherit(head, scopes: constant_scopes(context.first.to_type_name))
58
60
  end
59
61
 
60
- if head_constant
61
- tail.inject(head_constant) do |constant, name|
62
- resolve_constant_reference_inherit name,
63
- scopes: constant_scopes(constant.name),
64
- no_object: constant.name != BuiltinNames::Object.name
62
+ tail.inject(head_constant) do |constant, name|
63
+ if constant
64
+ resolve_constant_reference_inherit(
65
+ name,
66
+ scopes: constant_scopes(constant.name),
67
+ no_object: constant.name != BuiltinNames::Object.name
68
+ )
65
69
  end
66
70
  end
67
71
  end
@@ -150,9 +154,6 @@ module RBS
150
154
  when Environment::ModuleEntry
151
155
  constant_scopes0 BuiltinNames::Module.name, scopes: scopes
152
156
  constant_scopes_module name, scopes: scopes
153
-
154
- else
155
- raise "Unexpected declaration: #{name} (#{entry.class})"
156
157
  end
157
158
 
158
159
  scopes
@@ -40,7 +40,7 @@ module RBS
40
40
  if s = super_class
41
41
  yield s
42
42
  end
43
-
43
+
44
44
  self_types&.each(&block)
45
45
  included_modules&.each(&block)
46
46
  prepended_modules&.each(&block)
@@ -303,7 +303,7 @@ module RBS
303
303
  mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors)
304
304
  ancestors.unshift(*mod_ancestors.apply(arg_types, location: entry.primary.decl.location))
305
305
  end
306
- end
306
+ end
307
307
  end
308
308
 
309
309
  ancestors.unshift(self_ancestor)
@@ -316,7 +316,7 @@ module RBS
316
316
  mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors)
317
317
  ancestors.unshift(*mod_ancestors.apply(arg_types, location: entry.primary.decl.location))
318
318
  end
319
- end
319
+ end
320
320
  end
321
321
 
322
322
  building_ancestors.pop
@@ -814,8 +814,7 @@ module RBS
814
814
 
815
815
  methods.each do |name, method|
816
816
  method.method_types.each do |method_type|
817
- case method_type
818
- when MethodType
817
+ unless name == :initialize
819
818
  result = calculator.in_method_type(method_type: method_type, variables: param_names)
820
819
 
821
820
  validate_params_with type_params, result: result do |param|
@@ -13,7 +13,7 @@ module RBS
13
13
  def context
14
14
  @context ||= begin
15
15
  (outer + [decl]).each.with_object([Namespace.root]) do |decl, array|
16
- first = array.first or raise
16
+ first = array.first or raise
17
17
  array.unshift(first + decl.name.to_namespace)
18
18
  end
19
19
  end
@@ -258,6 +258,8 @@ module RBS
258
258
  outer: outer_,
259
259
  prefix: prefix_
260
260
  )
261
+ else
262
+ raise
261
263
  end
262
264
  end,
263
265
  location: decl.location,
@@ -288,6 +290,8 @@ module RBS
288
290
  outer: outer_,
289
291
  prefix: prefix_
290
292
  )
293
+ else
294
+ raise
291
295
  end
292
296
  end,
293
297
  location: decl.location,
@@ -9,14 +9,14 @@ module RBS
9
9
  end
10
10
  end
11
11
 
12
- LibraryPath = Struct.new(:name, :path, keyword_init: true)
13
- GemPath = Struct.new(:name, :version, :path, keyword_init: true)
12
+ LibraryPath = _ = Struct.new(:name, :path, keyword_init: true)
13
+ GemPath = _ = Struct.new(:name, :version, :path, keyword_init: true)
14
14
 
15
15
  attr_reader :paths
16
16
  attr_reader :stdlib_root
17
17
  attr_reader :gem_vendor_path
18
18
 
19
- STDLIB_ROOT = Pathname(__dir__) + "../../stdlib"
19
+ STDLIB_ROOT = Pathname(_ = __dir__) + "../../stdlib"
20
20
 
21
21
  def self.gem_sig_path(name, version)
22
22
  Pathname(Gem::Specification.find_by_name(name, version).gem_dir) + "sig"
@@ -50,22 +50,20 @@ module RBS
50
50
  end
51
51
 
52
52
  def self.parse_library(lib)
53
- lib.split(/:/)
53
+ _ = lib.split(/:/)
54
54
  end
55
55
 
56
56
  def stdlib?(name)
57
- if stdlib_root
58
- path = stdlib_root + name
59
- if path.directory?
60
- path
61
- end
57
+ path = stdlib_root + name
58
+ if path.directory?
59
+ path
62
60
  end
63
61
  end
64
62
 
65
63
  def gem?(name, version)
66
- if gem_vendor_path
64
+ if path = gem_vendor_path
67
65
  # Try vendored RBS first
68
- gem_dir = gem_vendor_path + name
66
+ gem_dir = path + name
69
67
  if gem_dir.directory?
70
68
  return gem_dir
71
69
  end
@@ -76,7 +74,7 @@ module RBS
76
74
  end
77
75
 
78
76
  def each_signature(path, immediate: true, &block)
79
- if block_given?
77
+ if block
80
78
  case
81
79
  when path.file?
82
80
  if path.extname == ".rbs" || immediate
@@ -116,6 +114,7 @@ module RBS
116
114
 
117
115
  def each_decl
118
116
  if block_given?
117
+ # @type var signature_files: Array[[path | :stdlib, Pathname]]
119
118
  signature_files = []
120
119
 
121
120
  unless no_builtin?
@@ -142,6 +141,7 @@ module RBS
142
141
  end
143
142
 
144
143
  def load(env:)
144
+ # @type var loadeds: Array[[AST::Declarations::t, Pathname, path | :stdlib]]
145
145
  loadeds = []
146
146
 
147
147
  each_decl do |decl, buffer, file_path, lib_path|