steep 1.3.2 → 1.4.0.dev.1
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/CHANGELOG.md +0 -12
- data/Gemfile +2 -0
- data/Gemfile.lock +13 -10
- data/Gemfile.steep +2 -1
- data/Gemfile.steep.lock +5 -4
- data/lib/steep/index/rbs_index.rb +13 -6
- data/lib/steep/project/dsl.rb +12 -4
- data/lib/steep/project/options.rb +3 -1
- data/lib/steep/version.rb +1 -1
- data/rbs_collection.steep.lock.yaml +46 -53
- data/sig/steep/index/rbs_index.rbs +83 -37
- data/sig/steep/project/dsl.rbs +35 -30
- data/sig/steep/project/options.rbs +16 -4
- data/smoke/diagnostics-rbs/test_expectations.yml +1 -1
- data/steep.gemspec +2 -1
- metadata +21 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bdccb93c5fd95bbc2e6af98021d0beadfb7aab30f3b398cb9e8414d5ea0e6f38
|
|
4
|
+
data.tar.gz: 6dfab6ba13555e6a6c37c69950383e1e7608c21bc26eacf1a695de91a5fe6293
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c09f6cd8780f428305edc405885c4080816470c05815515c8005e368532146b1e99e939699b3ff835d6909a2beeae074e38b79a1c8e2121652d008fc2f759316
|
|
7
|
+
data.tar.gz: a579bca90d0a7cd5a689068e7de97ca2d5ac9d7d40ccd291d2b61df57f519997bbf8c3e376904b4369c256aac75b62a5ee89915940436ded62c68212a4926e50
|
data/CHANGELOG.md
CHANGED
|
@@ -2,18 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## master
|
|
4
4
|
|
|
5
|
-
## 1.3.2 (2023-03-17)
|
|
6
|
-
|
|
7
|
-
### Miscellaneous
|
|
8
|
-
|
|
9
|
-
* Remove pathname from runtime_dependency ([#740](https://github.com/soutaro/steep/pull/740))
|
|
10
|
-
|
|
11
|
-
## 1.3.1 (2023-03-08)
|
|
12
|
-
|
|
13
|
-
### Miscellaneous
|
|
14
|
-
|
|
15
|
-
* Require rbs-2.8.x ([#732](https://github.com/soutaro/steep/pull/732))
|
|
16
|
-
|
|
17
5
|
## 1.3.0 (2022-11-25)
|
|
18
6
|
|
|
19
7
|
### Type checker core
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
steep (1.
|
|
4
|
+
steep (1.4.0.dev.1)
|
|
5
5
|
activesupport (>= 5.1)
|
|
6
6
|
csv (>= 3.0.9)
|
|
7
7
|
fileutils (>= 1.1.0)
|
|
@@ -11,8 +11,9 @@ PATH
|
|
|
11
11
|
logger (>= 1.3.0)
|
|
12
12
|
parallel (>= 1.0.0)
|
|
13
13
|
parser (>= 3.1)
|
|
14
|
+
pathname (>= 0.2.1)
|
|
14
15
|
rainbow (>= 2.2.2, < 4.0)
|
|
15
|
-
rbs (
|
|
16
|
+
rbs (>= 2.8.0)
|
|
16
17
|
securerandom (>= 0.1)
|
|
17
18
|
strscan (>= 1.0.0)
|
|
18
19
|
terminal-table (>= 2, < 4)
|
|
@@ -20,13 +21,13 @@ PATH
|
|
|
20
21
|
GEM
|
|
21
22
|
remote: https://rubygems.org/
|
|
22
23
|
specs:
|
|
23
|
-
activesupport (7.0.4
|
|
24
|
+
activesupport (7.0.4)
|
|
24
25
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
25
26
|
i18n (>= 1.6, < 2)
|
|
26
27
|
minitest (>= 5.1)
|
|
27
28
|
tzinfo (~> 2.0)
|
|
28
29
|
ast (2.4.2)
|
|
29
|
-
concurrent-ruby (1.
|
|
30
|
+
concurrent-ruby (1.1.10)
|
|
30
31
|
csv (3.2.6)
|
|
31
32
|
debase (0.2.5.beta2)
|
|
32
33
|
debase-ruby_core_source (>= 0.10.12)
|
|
@@ -36,8 +37,8 @@ GEM
|
|
|
36
37
|
i18n (1.12.0)
|
|
37
38
|
concurrent-ruby (~> 1.0)
|
|
38
39
|
json (2.6.3)
|
|
39
|
-
language_server-protocol (3.17.0.
|
|
40
|
-
listen (3.
|
|
40
|
+
language_server-protocol (3.17.0.2)
|
|
41
|
+
listen (3.7.1)
|
|
41
42
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
42
43
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
43
44
|
logger (1.5.3)
|
|
@@ -47,22 +48,23 @@ GEM
|
|
|
47
48
|
minitest-slow_test (0.2.0)
|
|
48
49
|
minitest (>= 5.0)
|
|
49
50
|
parallel (1.22.1)
|
|
50
|
-
parser (3.2.
|
|
51
|
+
parser (3.2.0.0)
|
|
51
52
|
ast (~> 2.4.1)
|
|
53
|
+
pathname (0.2.1)
|
|
52
54
|
rainbow (3.1.1)
|
|
53
55
|
rake (13.0.6)
|
|
54
56
|
rb-fsevent (0.11.2)
|
|
55
57
|
rb-inotify (0.10.1)
|
|
56
58
|
ffi (~> 1.0)
|
|
57
|
-
rbs (
|
|
59
|
+
rbs (3.0.0.dev.1)
|
|
58
60
|
ruby-debug-ide (0.7.3)
|
|
59
61
|
rake (>= 0.8.1)
|
|
60
62
|
securerandom (0.2.2)
|
|
61
63
|
stackprof (0.2.23)
|
|
62
|
-
strscan (3.0.
|
|
64
|
+
strscan (3.0.5)
|
|
63
65
|
terminal-table (3.0.2)
|
|
64
66
|
unicode-display_width (>= 1.1.1, < 3)
|
|
65
|
-
tzinfo (2.0.
|
|
67
|
+
tzinfo (2.0.5)
|
|
66
68
|
concurrent-ruby (~> 1.0)
|
|
67
69
|
unicode-display_width (2.4.2)
|
|
68
70
|
|
|
@@ -75,6 +77,7 @@ DEPENDENCIES
|
|
|
75
77
|
minitest-hooks
|
|
76
78
|
minitest-slow_test
|
|
77
79
|
rake
|
|
80
|
+
rbs (~> 3.0.0.dev)
|
|
78
81
|
ruby-debug-ide
|
|
79
82
|
stackprof
|
|
80
83
|
steep!
|
data/Gemfile.steep
CHANGED
data/Gemfile.steep.lock
CHANGED
|
@@ -27,9 +27,9 @@ GEM
|
|
|
27
27
|
rb-fsevent (0.11.2)
|
|
28
28
|
rb-inotify (0.10.1)
|
|
29
29
|
ffi (~> 1.0)
|
|
30
|
-
rbs (
|
|
30
|
+
rbs (3.0.0.dev.1)
|
|
31
31
|
securerandom (0.2.0)
|
|
32
|
-
steep (1.3.0
|
|
32
|
+
steep (1.3.0)
|
|
33
33
|
activesupport (>= 5.1)
|
|
34
34
|
csv (>= 3.0.9)
|
|
35
35
|
fileutils (>= 1.1.0)
|
|
@@ -40,7 +40,7 @@ GEM
|
|
|
40
40
|
parallel (>= 1.0.0)
|
|
41
41
|
parser (>= 3.1)
|
|
42
42
|
rainbow (>= 2.2.2, < 4.0)
|
|
43
|
-
rbs (>= 2.8.0
|
|
43
|
+
rbs (>= 2.8.0)
|
|
44
44
|
securerandom (>= 0.1)
|
|
45
45
|
strscan (>= 1.0.0)
|
|
46
46
|
terminal-table (>= 2, < 4)
|
|
@@ -55,7 +55,8 @@ PLATFORMS
|
|
|
55
55
|
arm64-darwin-21
|
|
56
56
|
|
|
57
57
|
DEPENDENCIES
|
|
58
|
-
|
|
58
|
+
rbs (~> 3.0.0.dev)
|
|
59
|
+
steep (~> 1.3.0)
|
|
59
60
|
|
|
60
61
|
BUNDLED WITH
|
|
61
62
|
2.3.15
|
|
@@ -148,7 +148,7 @@ module Steep
|
|
|
148
148
|
end
|
|
149
149
|
|
|
150
150
|
def each_entry(&block)
|
|
151
|
-
if
|
|
151
|
+
if block
|
|
152
152
|
type_index.each_value(&block)
|
|
153
153
|
method_index.each_value(&block)
|
|
154
154
|
const_index.each_value(&block)
|
|
@@ -176,7 +176,7 @@ module Steep
|
|
|
176
176
|
|
|
177
177
|
def each_declaration(type_name: nil, method_name: nil, const_name: nil, global_name: nil, &block)
|
|
178
178
|
if block
|
|
179
|
-
entry = entry(type_name: type_name, method_name: method_name, const_name: const_name, global_name: global_name)
|
|
179
|
+
entry = __skip__ = entry(type_name: type_name, method_name: method_name, const_name: const_name, global_name: global_name)
|
|
180
180
|
entry.declarations.each(&block)
|
|
181
181
|
else
|
|
182
182
|
enum_for(:each_declaration, type_name: type_name, method_name: method_name, const_name: const_name, global_name: global_name)
|
|
@@ -187,9 +187,12 @@ module Steep
|
|
|
187
187
|
entry(type_name: type_name).add_reference(ref)
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
def each_reference(type_name
|
|
190
|
+
def each_reference(type_name:, &block)
|
|
191
191
|
if block
|
|
192
|
-
|
|
192
|
+
case
|
|
193
|
+
when type_name
|
|
194
|
+
entry(type_name: type_name).references.each(&block)
|
|
195
|
+
end
|
|
193
196
|
else
|
|
194
197
|
enum_for(:each_reference, type_name: type_name)
|
|
195
198
|
end
|
|
@@ -205,8 +208,8 @@ module Steep
|
|
|
205
208
|
def member(type_name, member)
|
|
206
209
|
case member
|
|
207
210
|
when RBS::AST::Members::MethodDefinition
|
|
208
|
-
member.
|
|
209
|
-
method_type.each_type do |type|
|
|
211
|
+
member.overloads.each do |overload|
|
|
212
|
+
overload.method_type.each_type do |type|
|
|
210
213
|
type_reference type, from: member
|
|
211
214
|
end
|
|
212
215
|
end
|
|
@@ -230,6 +233,8 @@ module Steep
|
|
|
230
233
|
InstanceMethodName.new(type_name: type_name, method_name: member.name)
|
|
231
234
|
when :singleton
|
|
232
235
|
SingletonMethodName.new(type_name: type_name, method_name: member.name)
|
|
236
|
+
else
|
|
237
|
+
raise
|
|
233
238
|
end
|
|
234
239
|
index.add_method_declaration(method_name, member)
|
|
235
240
|
end
|
|
@@ -240,6 +245,8 @@ module Steep
|
|
|
240
245
|
InstanceMethodName.new(type_name: type_name, method_name: "#{member.name}=".to_sym)
|
|
241
246
|
when :singleton
|
|
242
247
|
SingletonMethodName.new(type_name: type_name, method_name: "#{member.name}=".to_sym)
|
|
248
|
+
else
|
|
249
|
+
raise
|
|
243
250
|
end
|
|
244
251
|
index.add_method_declaration(method_name, member)
|
|
245
252
|
end
|
data/lib/steep/project/dsl.rb
CHANGED
|
@@ -172,8 +172,12 @@ module Steep
|
|
|
172
172
|
yield code_diagnostics_config if block_given?
|
|
173
173
|
end
|
|
174
174
|
|
|
175
|
+
def project!
|
|
176
|
+
project or raise "TargetDSL doesn't have project (#{name})"
|
|
177
|
+
end
|
|
178
|
+
|
|
175
179
|
def collection_config(path)
|
|
176
|
-
@collection_config_path = project
|
|
180
|
+
@collection_config_path = project!.absolute_path(path)
|
|
177
181
|
end
|
|
178
182
|
|
|
179
183
|
def disable_collection
|
|
@@ -196,7 +200,6 @@ module Steep
|
|
|
196
200
|
|
|
197
201
|
def initialize(project:)
|
|
198
202
|
@project = project
|
|
199
|
-
@global_signatures = []
|
|
200
203
|
end
|
|
201
204
|
|
|
202
205
|
def self.register_template(name, target)
|
|
@@ -218,13 +221,18 @@ module Steep
|
|
|
218
221
|
end
|
|
219
222
|
|
|
220
223
|
Steep.logger.tagged "target=#{name}" do
|
|
221
|
-
target.instance_eval(&block) if
|
|
224
|
+
target.instance_eval(&block) if block
|
|
222
225
|
end
|
|
223
226
|
|
|
224
227
|
source_pattern = Pattern.new(patterns: target.sources, ignores: target.ignored_sources, ext: ".rb")
|
|
225
228
|
signature_pattern = Pattern.new(patterns: target.signatures, ext: ".rbs")
|
|
226
229
|
|
|
227
|
-
|
|
230
|
+
|
|
231
|
+
if config_path = target.collection_config_path
|
|
232
|
+
lockfile_path = RBS::Collection::Config.to_lockfile_path(config_path)
|
|
233
|
+
content = YAML.load_file(lockfile_path.to_s)
|
|
234
|
+
collection_lock = RBS::Collection::Config::Lockfile.from_lockfile(lockfile_path: lockfile_path, data: content)
|
|
235
|
+
end
|
|
228
236
|
|
|
229
237
|
Project::Target.new(
|
|
230
238
|
name: target.name,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
module Steep
|
|
2
2
|
class Project
|
|
3
3
|
class Options
|
|
4
|
-
PathOptions = Struct.new(:core_root, :stdlib_root, :repo_paths, keyword_init: true) do
|
|
4
|
+
PathOptions = _ = Struct.new(:core_root, :stdlib_root, :repo_paths, keyword_init: true) do
|
|
5
|
+
# @implements PathOptions
|
|
6
|
+
|
|
5
7
|
def customized_stdlib?
|
|
6
8
|
stdlib_root != nil
|
|
7
9
|
end
|
data/lib/steep/version.rb
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
sources:
|
|
3
|
-
-
|
|
3
|
+
- type: git
|
|
4
|
+
name: ruby/gem_rbs_collection
|
|
5
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
4
6
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
5
|
-
revision: main
|
|
6
7
|
repo_dir: gems
|
|
7
8
|
path: ".gem_rbs_collection"
|
|
8
9
|
gems:
|
|
9
|
-
- name: set
|
|
10
|
-
version: '0'
|
|
11
|
-
source:
|
|
12
|
-
type: stdlib
|
|
13
|
-
- name: rbs
|
|
14
|
-
version: 2.8.0
|
|
15
|
-
source:
|
|
16
|
-
type: rubygems
|
|
17
|
-
- name: dbm
|
|
18
|
-
version: '0'
|
|
19
|
-
source:
|
|
20
|
-
type: stdlib
|
|
21
10
|
- name: activesupport
|
|
22
|
-
version: '
|
|
11
|
+
version: '6.0'
|
|
23
12
|
source:
|
|
24
13
|
type: git
|
|
25
14
|
name: ruby/gem_rbs_collection
|
|
26
|
-
revision:
|
|
15
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
27
16
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
28
17
|
repo_dir: gems
|
|
29
18
|
- name: ast
|
|
@@ -31,31 +20,35 @@ gems:
|
|
|
31
20
|
source:
|
|
32
21
|
type: git
|
|
33
22
|
name: ruby/gem_rbs_collection
|
|
34
|
-
revision:
|
|
35
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
36
|
-
repo_dir: gems
|
|
37
|
-
- name: concurrent-ruby
|
|
38
|
-
version: '1.1'
|
|
39
|
-
source:
|
|
40
|
-
type: git
|
|
41
|
-
name: ruby/gem_rbs_collection
|
|
42
|
-
revision: 8f2be26c03ad81a7124927ebc4f8e066ba94b92b
|
|
23
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
43
24
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
44
25
|
repo_dir: gems
|
|
45
26
|
- name: csv
|
|
46
27
|
version: '0'
|
|
47
28
|
source:
|
|
48
29
|
type: stdlib
|
|
30
|
+
- name: date
|
|
31
|
+
version: '0'
|
|
32
|
+
source:
|
|
33
|
+
type: stdlib
|
|
34
|
+
- name: dbm
|
|
35
|
+
version: '0'
|
|
36
|
+
source:
|
|
37
|
+
type: stdlib
|
|
49
38
|
- name: fileutils
|
|
50
39
|
version: '0'
|
|
51
40
|
source:
|
|
52
41
|
type: stdlib
|
|
42
|
+
- name: forwardable
|
|
43
|
+
version: '0'
|
|
44
|
+
source:
|
|
45
|
+
type: stdlib
|
|
53
46
|
- name: i18n
|
|
54
47
|
version: '1.10'
|
|
55
48
|
source:
|
|
56
49
|
type: git
|
|
57
50
|
name: ruby/gem_rbs_collection
|
|
58
|
-
revision:
|
|
51
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
59
52
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
60
53
|
repo_dir: gems
|
|
61
54
|
- name: json
|
|
@@ -67,7 +60,7 @@ gems:
|
|
|
67
60
|
source:
|
|
68
61
|
type: git
|
|
69
62
|
name: ruby/gem_rbs_collection
|
|
70
|
-
revision:
|
|
63
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
71
64
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
72
65
|
repo_dir: gems
|
|
73
66
|
- name: logger
|
|
@@ -78,59 +71,59 @@ gems:
|
|
|
78
71
|
version: '0'
|
|
79
72
|
source:
|
|
80
73
|
type: stdlib
|
|
74
|
+
- name: monitor
|
|
75
|
+
version: '0'
|
|
76
|
+
source:
|
|
77
|
+
type: stdlib
|
|
78
|
+
- name: mutex_m
|
|
79
|
+
version: '0'
|
|
80
|
+
source:
|
|
81
|
+
type: stdlib
|
|
82
|
+
- name: optparse
|
|
83
|
+
version: '0'
|
|
84
|
+
source:
|
|
85
|
+
type: stdlib
|
|
81
86
|
- name: parallel
|
|
82
87
|
version: '1.20'
|
|
83
88
|
source:
|
|
84
89
|
type: git
|
|
85
90
|
name: ruby/gem_rbs_collection
|
|
86
|
-
revision:
|
|
91
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
87
92
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
88
93
|
repo_dir: gems
|
|
94
|
+
- name: pathname
|
|
95
|
+
version: '0'
|
|
96
|
+
source:
|
|
97
|
+
type: stdlib
|
|
89
98
|
- name: rainbow
|
|
90
99
|
version: '3.0'
|
|
91
100
|
source:
|
|
92
101
|
type: git
|
|
93
102
|
name: ruby/gem_rbs_collection
|
|
94
|
-
revision:
|
|
103
|
+
revision: 6f9f54a753a78c505e63e7f31a48b3f71f1b510d
|
|
95
104
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
96
105
|
repo_dir: gems
|
|
97
|
-
- name:
|
|
98
|
-
version:
|
|
99
|
-
source:
|
|
100
|
-
type: stdlib
|
|
101
|
-
- name: strscan
|
|
102
|
-
version: '0'
|
|
103
|
-
source:
|
|
104
|
-
type: stdlib
|
|
105
|
-
- name: pathname
|
|
106
|
-
version: '0'
|
|
107
|
-
source:
|
|
108
|
-
type: stdlib
|
|
109
|
-
- name: optparse
|
|
110
|
-
version: '0'
|
|
111
|
-
source:
|
|
112
|
-
type: stdlib
|
|
113
|
-
- name: tsort
|
|
114
|
-
version: '0'
|
|
106
|
+
- name: rbs
|
|
107
|
+
version: 3.0.0.dev.1
|
|
115
108
|
source:
|
|
116
|
-
type:
|
|
109
|
+
type: rubygems
|
|
117
110
|
- name: rdoc
|
|
118
111
|
version: '0'
|
|
119
112
|
source:
|
|
120
113
|
type: stdlib
|
|
121
|
-
- name:
|
|
114
|
+
- name: securerandom
|
|
122
115
|
version: '0'
|
|
123
116
|
source:
|
|
124
117
|
type: stdlib
|
|
125
|
-
- name:
|
|
118
|
+
- name: set
|
|
126
119
|
version: '0'
|
|
127
120
|
source:
|
|
128
121
|
type: stdlib
|
|
129
|
-
- name:
|
|
122
|
+
- name: singleton
|
|
130
123
|
version: '0'
|
|
131
124
|
source:
|
|
132
125
|
type: stdlib
|
|
133
|
-
- name:
|
|
126
|
+
- name: strscan
|
|
134
127
|
version: '0'
|
|
135
128
|
source:
|
|
136
129
|
type: stdlib
|
|
@@ -138,7 +131,7 @@ gems:
|
|
|
138
131
|
version: '0'
|
|
139
132
|
source:
|
|
140
133
|
type: stdlib
|
|
141
|
-
- name:
|
|
134
|
+
- name: tsort
|
|
142
135
|
version: '0'
|
|
143
136
|
source:
|
|
144
137
|
type: stdlib
|
|
@@ -2,89 +2,135 @@ module Steep
|
|
|
2
2
|
module Index
|
|
3
3
|
class RBSIndex
|
|
4
4
|
class TypeEntry
|
|
5
|
-
attr_reader type_name:
|
|
5
|
+
attr_reader type_name: RBS::TypeName
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
type decl = RBS::AST::Declarations::Class
|
|
8
|
+
| RBS::AST::Declarations::Module
|
|
9
|
+
| RBS::AST::Declarations::Interface
|
|
10
|
+
| RBS::AST::Declarations::Alias
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
type ref = RBS::AST::Members::MethodDefinition
|
|
13
|
+
| RBS::AST::Members::AttrWriter
|
|
14
|
+
| RBS::AST::Members::AttrReader
|
|
15
|
+
| RBS::AST::Members::AttrAccessor
|
|
16
|
+
| RBS::AST::Members::Include
|
|
17
|
+
| RBS::AST::Members::Extend
|
|
18
|
+
| RBS::AST::Members::InstanceVariable
|
|
19
|
+
| RBS::AST::Members::ClassVariable
|
|
20
|
+
| RBS::AST::Members::ClassInstanceVariable
|
|
21
|
+
| RBS::AST::Declarations::Module
|
|
22
|
+
| RBS::AST::Declarations::Class
|
|
23
|
+
| RBS::AST::Declarations::Constant
|
|
24
|
+
| RBS::AST::Declarations::Global
|
|
25
|
+
| RBS::AST::Declarations::Alias
|
|
10
26
|
|
|
11
|
-
|
|
27
|
+
attr_reader declarations: Set[decl]
|
|
12
28
|
|
|
13
|
-
|
|
29
|
+
attr_reader references: Set[ref]
|
|
14
30
|
|
|
15
|
-
def
|
|
31
|
+
def initialize: (type_name: RBS::TypeName) -> void
|
|
32
|
+
|
|
33
|
+
def add_declaration: (decl decl) -> self
|
|
34
|
+
|
|
35
|
+
def add_reference: (ref) -> self
|
|
16
36
|
end
|
|
17
37
|
|
|
18
38
|
class MethodEntry
|
|
19
|
-
attr_reader method_name:
|
|
39
|
+
attr_reader method_name: method_name
|
|
40
|
+
|
|
41
|
+
type decl = RBS::AST::Members::MethodDefinition
|
|
42
|
+
| RBS::AST::Members::Alias
|
|
43
|
+
| RBS::AST::Members::AttrWriter
|
|
44
|
+
| RBS::AST::Members::AttrReader
|
|
45
|
+
| RBS::AST::Members::AttrAccessor
|
|
20
46
|
|
|
21
|
-
|
|
47
|
+
type ref = RBS::AST::Members::Alias
|
|
22
48
|
|
|
23
|
-
attr_reader
|
|
49
|
+
attr_reader declarations: Set[decl]
|
|
24
50
|
|
|
25
|
-
|
|
51
|
+
attr_reader references: Set[ref]
|
|
26
52
|
|
|
27
|
-
def
|
|
53
|
+
def initialize: (method_name: method_name) -> void
|
|
54
|
+
|
|
55
|
+
def add_declaration: (decl) -> self
|
|
28
56
|
end
|
|
29
57
|
|
|
30
58
|
class ConstantEntry
|
|
31
|
-
attr_reader const_name:
|
|
59
|
+
attr_reader const_name: RBS::TypeName
|
|
60
|
+
|
|
61
|
+
type decl = RBS::AST::Declarations::Constant
|
|
32
62
|
|
|
33
|
-
attr_reader declarations:
|
|
63
|
+
attr_reader declarations: Set[decl]
|
|
34
64
|
|
|
35
|
-
def initialize: (const_name:
|
|
65
|
+
def initialize: (const_name: RBS::TypeName) -> void
|
|
36
66
|
|
|
37
|
-
def add_declaration: (
|
|
67
|
+
def add_declaration: (decl) -> self
|
|
38
68
|
end
|
|
39
69
|
|
|
40
70
|
class GlobalEntry
|
|
41
|
-
attr_reader global_name:
|
|
71
|
+
attr_reader global_name: Symbol
|
|
72
|
+
|
|
73
|
+
type decl = RBS::AST::Declarations::Global
|
|
42
74
|
|
|
43
|
-
attr_reader declarations:
|
|
75
|
+
attr_reader declarations: Set[decl]
|
|
44
76
|
|
|
45
|
-
def initialize: (global_name:
|
|
77
|
+
def initialize: (global_name: Symbol) -> void
|
|
46
78
|
|
|
47
|
-
def add_declaration: (
|
|
79
|
+
def add_declaration: (decl) -> self
|
|
48
80
|
end
|
|
49
81
|
|
|
50
|
-
attr_reader type_index:
|
|
82
|
+
attr_reader type_index: Hash[RBS::TypeName, TypeEntry]
|
|
51
83
|
|
|
52
|
-
attr_reader method_index:
|
|
84
|
+
attr_reader method_index: Hash[method_name, MethodEntry]
|
|
53
85
|
|
|
54
|
-
attr_reader const_index:
|
|
86
|
+
attr_reader const_index: Hash[RBS::TypeName, ConstantEntry]
|
|
55
87
|
|
|
56
|
-
attr_reader global_index:
|
|
88
|
+
attr_reader global_index: Hash[Symbol, GlobalEntry]
|
|
57
89
|
|
|
58
90
|
def initialize: () -> void
|
|
59
91
|
|
|
60
|
-
def entry: (
|
|
92
|
+
def entry: (type_name: RBS::TypeName) -> TypeEntry
|
|
93
|
+
| (method_name: method_name) -> MethodEntry
|
|
94
|
+
| (const_name: RBS::TypeName) -> ConstantEntry
|
|
95
|
+
| (global_name: Symbol) -> GlobalEntry
|
|
61
96
|
|
|
62
|
-
def each_entry: () { () ->
|
|
97
|
+
def each_entry: () { (TypeEntry | MethodEntry | ConstantEntry | GlobalEntry) -> void } -> void
|
|
98
|
+
| () -> Enumerator[TypeEntry | MethodEntry | ConstantEntry | GlobalEntry, void]
|
|
63
99
|
|
|
64
|
-
def add_type_declaration: (
|
|
100
|
+
def add_type_declaration: (RBS::TypeName type_name, TypeEntry::decl declaration) -> TypeEntry
|
|
65
101
|
|
|
66
|
-
def add_method_declaration: (
|
|
102
|
+
def add_method_declaration: (method_name, MethodEntry::decl member) -> MethodEntry
|
|
67
103
|
|
|
68
|
-
def add_constant_declaration: (
|
|
104
|
+
def add_constant_declaration: (RBS::TypeName const_name, ConstantEntry::decl decl) -> ConstantEntry
|
|
69
105
|
|
|
70
|
-
def add_global_declaration: (
|
|
106
|
+
def add_global_declaration: (Symbol global_name, GlobalEntry::decl decl) -> GlobalEntry
|
|
71
107
|
|
|
72
|
-
def each_declaration: (
|
|
108
|
+
def each_declaration: (type_name: RBS::TypeName) { (TypeEntry) -> void } -> void
|
|
109
|
+
| (type_name: RBS::TypeName) -> Enumerator[TypeEntry, void]
|
|
110
|
+
| (method_name: method_name) { (MethodEntry) -> void } -> void
|
|
111
|
+
| (method_name: method_name) -> Enumerator[MethodEntry, void]
|
|
112
|
+
| (const_name: RBS::TypeName) { (ConstantEntry) -> void } -> void
|
|
113
|
+
| (const_name: RBS::TypeName) -> Enumerator[ConstantEntry, void]
|
|
114
|
+
| (global_name: Symbol) { (GlobalEntry) -> void } -> void
|
|
115
|
+
| (global_name: Symbol) -> Enumerator[GlobalEntry, void]
|
|
73
116
|
|
|
74
|
-
|
|
117
|
+
# `type_name` is referred from `ref`
|
|
118
|
+
#
|
|
119
|
+
def add_type_reference: (RBS::TypeName type_name, TypeEntry::ref ref) -> TypeEntry
|
|
75
120
|
|
|
76
|
-
def each_reference: (
|
|
121
|
+
def each_reference: (type_name: RBS::TypeName) { (TypeEntry::ref) -> void } -> void
|
|
122
|
+
| (type_name: RBS::TypeName) -> Enumerator[TypeEntry::ref, void]
|
|
77
123
|
|
|
78
124
|
class Builder
|
|
79
|
-
attr_reader index:
|
|
125
|
+
attr_reader index: RBSIndex
|
|
80
126
|
|
|
81
|
-
def initialize: (index:
|
|
127
|
+
def initialize: (index: RBSIndex) -> void
|
|
82
128
|
|
|
83
|
-
def member: (
|
|
129
|
+
def member: (RBS::TypeName type_name, RBS::AST::Members::t | RBS::AST::Declarations::t member) -> void
|
|
84
130
|
|
|
85
|
-
def type_reference: (
|
|
131
|
+
def type_reference: (RBS::Types::t, from: TypeEntry::ref) -> void
|
|
86
132
|
|
|
87
|
-
def env: (
|
|
133
|
+
def env: (RBS::Environment env) -> void
|
|
88
134
|
end
|
|
89
135
|
end
|
|
90
136
|
end
|
data/sig/steep/project/dsl.rbs
CHANGED
|
@@ -2,53 +2,55 @@ module Steep
|
|
|
2
2
|
class Project
|
|
3
3
|
class DSL
|
|
4
4
|
class TargetDSL
|
|
5
|
-
attr_reader name:
|
|
5
|
+
attr_reader name: Symbol
|
|
6
6
|
|
|
7
|
-
attr_reader sources:
|
|
7
|
+
attr_reader sources: Array[String]
|
|
8
8
|
|
|
9
|
-
attr_reader libraries:
|
|
9
|
+
attr_reader libraries: Array[String]
|
|
10
10
|
|
|
11
|
-
attr_reader signatures:
|
|
11
|
+
attr_reader signatures: Array[String]
|
|
12
12
|
|
|
13
|
-
attr_reader ignored_sources:
|
|
13
|
+
attr_reader ignored_sources: Array[String]
|
|
14
14
|
|
|
15
|
-
attr_reader stdlib_root:
|
|
15
|
+
attr_reader stdlib_root: Pathname?
|
|
16
16
|
|
|
17
|
-
attr_reader core_root:
|
|
17
|
+
attr_reader core_root: Pathname?
|
|
18
18
|
|
|
19
|
-
attr_reader repo_paths:
|
|
19
|
+
attr_reader repo_paths: Array[Pathname]
|
|
20
20
|
|
|
21
21
|
attr_reader code_diagnostics_config: untyped
|
|
22
22
|
|
|
23
|
-
attr_reader project:
|
|
23
|
+
attr_reader project: Project?
|
|
24
24
|
|
|
25
|
-
attr_reader collection_config_path:
|
|
25
|
+
attr_reader collection_config_path: Pathname?
|
|
26
26
|
|
|
27
27
|
NONE: untyped
|
|
28
28
|
|
|
29
|
-
def
|
|
29
|
+
def project!: () -> Project
|
|
30
30
|
|
|
31
|
-
def
|
|
31
|
+
def initialize: (Symbol name, ?sources: Array[String], ?libraries: Array[String], ?signatures: Array[String], ?ignored_sources: Array[String], ?repo_paths: Array[Pathname], ?code_diagnostics_config: ::Hash[untyped, untyped], ?project: Project?, ?collection_config_path: Pathname?) -> void
|
|
32
32
|
|
|
33
|
-
def
|
|
33
|
+
def initialize_copy: (instance other) -> void
|
|
34
34
|
|
|
35
|
-
def
|
|
35
|
+
def check: (*String args) -> void
|
|
36
36
|
|
|
37
|
-
def
|
|
37
|
+
def ignore: (*String args) -> void
|
|
38
38
|
|
|
39
|
-
def
|
|
39
|
+
def library: (*String args) -> void
|
|
40
40
|
|
|
41
|
-
def
|
|
41
|
+
def typing_options: (?untyped level, **untyped hash) -> void
|
|
42
42
|
|
|
43
|
-
def
|
|
43
|
+
def signature: (*String args) -> void
|
|
44
44
|
|
|
45
|
-
def
|
|
45
|
+
def update: (?name: Symbol, ?sources: Array[String], ?libraries: Array[String], ?signatures: Array[String], ?ignored_sources: Array[String], ?project: Project?) -> TargetDSL
|
|
46
46
|
|
|
47
|
-
def
|
|
47
|
+
def no_builtin!: (?bool value) -> void
|
|
48
48
|
|
|
49
|
-
def
|
|
49
|
+
def vendor: (?::String dir, ?stdlib: untyped?, ?gems: untyped?) -> void
|
|
50
50
|
|
|
51
|
-
def
|
|
51
|
+
def stdlib_path: (core_root: String, stdlib_root: String) -> void
|
|
52
|
+
|
|
53
|
+
def repo_path: (*String paths) -> void
|
|
52
54
|
|
|
53
55
|
# Configure the code diagnostics printing setup.
|
|
54
56
|
#
|
|
@@ -71,24 +73,27 @@ module Steep
|
|
|
71
73
|
# configure_code_diagnostics(D::Ruby.lenient)
|
|
72
74
|
# ```
|
|
73
75
|
#
|
|
74
|
-
def configure_code_diagnostics: (
|
|
76
|
+
def configure_code_diagnostics: (Hash[untyped, untyped] hash) -> void
|
|
77
|
+
| () { (Hash[untyped, untyped]) -> void } -> void
|
|
75
78
|
|
|
76
|
-
def collection_config: (
|
|
79
|
+
def collection_config: (Pathname path) -> void
|
|
77
80
|
|
|
78
|
-
def disable_collection: () ->
|
|
81
|
+
def disable_collection: () -> void
|
|
79
82
|
end
|
|
80
83
|
|
|
81
84
|
attr_reader project: untyped
|
|
82
85
|
|
|
83
|
-
|
|
86
|
+
@@templates: Hash[Symbol, TargetDSL]
|
|
87
|
+
|
|
88
|
+
def self.templates: () -> Hash[Symbol, TargetDSL]
|
|
84
89
|
|
|
85
|
-
def initialize: (project:
|
|
90
|
+
def initialize: (project: Project) -> void
|
|
86
91
|
|
|
87
|
-
def self.register_template: (
|
|
92
|
+
def self.register_template: (Symbol name, TargetDSL target) -> void
|
|
88
93
|
|
|
89
|
-
def self.parse: (
|
|
94
|
+
def self.parse: (Project project, String code, ?filename: String) -> void
|
|
90
95
|
|
|
91
|
-
def target: (
|
|
96
|
+
def target: (Symbol name, ?template: Symbol?) ?{ (TargetDSL) [self: TargetDSL] -> void } -> void
|
|
92
97
|
end
|
|
93
98
|
end
|
|
94
99
|
end
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
module Steep
|
|
2
2
|
class Project
|
|
3
3
|
class Options
|
|
4
|
-
PathOptions
|
|
4
|
+
class PathOptions
|
|
5
|
+
attr_reader core_root: Pathname?
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
attr_reader stdlib_root: Pathname?
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
attr_reader repo_paths: Array[Pathname]
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
def initialize: (?core_root: Pathname?, ?stdlib_root: Pathname?, ?repo_paths: Array[Pathname]) -> void
|
|
12
|
+
|
|
13
|
+
def customized_stdlib?: () -> bool
|
|
14
|
+
|
|
15
|
+
def customized_core?: () -> bool
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
attr_reader libraries: Array[String]
|
|
19
|
+
|
|
20
|
+
attr_accessor paths: PathOptions
|
|
21
|
+
|
|
22
|
+
attr_accessor collection_lock: RBS::Collection::Config::Lockfile
|
|
11
23
|
|
|
12
24
|
def initialize: () -> void
|
|
13
25
|
end
|
data/steep.gemspec
CHANGED
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.add_runtime_dependency "rainbow", ">= 2.2.2", "< 4.0"
|
|
34
34
|
spec.add_runtime_dependency "listen", "~> 3.0"
|
|
35
35
|
spec.add_runtime_dependency "language_server-protocol", ">= 3.15", "< 4.0"
|
|
36
|
-
spec.add_runtime_dependency "rbs", "
|
|
36
|
+
spec.add_runtime_dependency "rbs", ">= 2.8.0"
|
|
37
37
|
spec.add_runtime_dependency "parallel", ">= 1.0.0"
|
|
38
38
|
spec.add_runtime_dependency "terminal-table", ">= 2", "< 4"
|
|
39
39
|
spec.add_runtime_dependency "securerandom", ">= 0.1"
|
|
@@ -42,4 +42,5 @@ Gem::Specification.new do |spec|
|
|
|
42
42
|
spec.add_runtime_dependency "fileutils", ">= 1.1.0"
|
|
43
43
|
spec.add_runtime_dependency "strscan", ">= 1.0.0"
|
|
44
44
|
spec.add_runtime_dependency "csv", ">= 3.0.9"
|
|
45
|
+
spec.add_runtime_dependency "pathname", ">= 0.2.1"
|
|
45
46
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: steep
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0.dev.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Soutaro Matsumoto
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-01-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parser
|
|
@@ -96,14 +96,14 @@ dependencies:
|
|
|
96
96
|
name: rbs
|
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
|
98
98
|
requirements:
|
|
99
|
-
- - "
|
|
99
|
+
- - ">="
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
101
|
version: 2.8.0
|
|
102
102
|
type: :runtime
|
|
103
103
|
prerelease: false
|
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
105
|
requirements:
|
|
106
|
-
- - "
|
|
106
|
+
- - ">="
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
108
|
version: 2.8.0
|
|
109
109
|
- !ruby/object:Gem::Dependency
|
|
@@ -224,6 +224,20 @@ dependencies:
|
|
|
224
224
|
- - ">="
|
|
225
225
|
- !ruby/object:Gem::Version
|
|
226
226
|
version: 3.0.9
|
|
227
|
+
- !ruby/object:Gem::Dependency
|
|
228
|
+
name: pathname
|
|
229
|
+
requirement: !ruby/object:Gem::Requirement
|
|
230
|
+
requirements:
|
|
231
|
+
- - ">="
|
|
232
|
+
- !ruby/object:Gem::Version
|
|
233
|
+
version: 0.2.1
|
|
234
|
+
type: :runtime
|
|
235
|
+
prerelease: false
|
|
236
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
237
|
+
requirements:
|
|
238
|
+
- - ">="
|
|
239
|
+
- !ruby/object:Gem::Version
|
|
240
|
+
version: 0.2.1
|
|
227
241
|
description: Gradual Typing for Ruby
|
|
228
242
|
email:
|
|
229
243
|
- matsumoto@soutaro.com
|
|
@@ -764,11 +778,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
764
778
|
version: 2.7.0
|
|
765
779
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
766
780
|
requirements:
|
|
767
|
-
- - "
|
|
781
|
+
- - ">"
|
|
768
782
|
- !ruby/object:Gem::Version
|
|
769
|
-
version:
|
|
783
|
+
version: 1.3.1
|
|
770
784
|
requirements: []
|
|
771
|
-
rubygems_version: 3.
|
|
785
|
+
rubygems_version: 3.3.26
|
|
772
786
|
signing_key:
|
|
773
787
|
specification_version: 4
|
|
774
788
|
summary: Gradual Typing for Ruby
|