steep 0.43.1 → 0.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/ruby.yml +4 -2
- data/.gitignore +0 -1
- data/CHANGELOG.md +41 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +77 -0
- data/bin/output_test.rb +8 -2
- data/lib/steep/ast/builtin.rb +7 -1
- data/lib/steep/ast/types/factory.rb +19 -25
- data/lib/steep/cli.rb +7 -1
- data/lib/steep/diagnostic/lsp_formatter.rb +59 -6
- data/lib/steep/diagnostic/ruby.rb +188 -60
- data/lib/steep/diagnostic/signature.rb +34 -0
- data/lib/steep/drivers/check.rb +3 -0
- data/lib/steep/drivers/init.rb +10 -3
- data/lib/steep/drivers/utils/driver_helper.rb +15 -0
- data/lib/steep/drivers/validate.rb +1 -1
- data/lib/steep/drivers/watch.rb +3 -0
- data/lib/steep/equatable.rb +21 -0
- data/lib/steep/index/source_index.rb +55 -5
- data/lib/steep/interface/block.rb +4 -0
- data/lib/steep/interface/function.rb +798 -579
- data/lib/steep/project/dsl.rb +105 -33
- data/lib/steep/project/options.rb +12 -53
- data/lib/steep/project/target.rb +21 -8
- data/lib/steep/server/interaction_worker.rb +239 -20
- data/lib/steep/server/master.rb +22 -1
- data/lib/steep/server/type_check_worker.rb +74 -9
- data/lib/steep/services/file_loader.rb +26 -19
- data/lib/steep/services/goto_service.rb +322 -0
- data/lib/steep/services/hover_content.rb +132 -80
- data/lib/steep/services/type_check_service.rb +25 -0
- data/lib/steep/source.rb +7 -10
- data/lib/steep/type_construction.rb +496 -518
- data/lib/steep/type_inference/block_params.rb +2 -5
- data/lib/steep/type_inference/method_params.rb +483 -0
- data/lib/steep/type_inference/send_args.rb +610 -128
- data/lib/steep/typing.rb +46 -21
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +4 -1
- data/sample/Steepfile +10 -3
- data/sig/steep/type_inference/send_args.rbs +42 -0
- data/smoke/alias/Steepfile +2 -1
- data/smoke/and/Steepfile +2 -1
- data/smoke/array/Steepfile +2 -1
- data/smoke/array/test_expectations.yml +3 -3
- data/smoke/block/Steepfile +2 -2
- data/smoke/block/c.rb +0 -1
- data/smoke/case/Steepfile +2 -1
- data/smoke/class/Steepfile +2 -1
- data/smoke/class/test_expectations.yml +12 -15
- data/smoke/const/Steepfile +2 -1
- data/smoke/const/test_expectations.yml +0 -10
- data/smoke/diagnostics/Steepfile +2 -1
- data/smoke/diagnostics/a.rbs +0 -4
- data/smoke/diagnostics/different_method_parameter_kind.rb +9 -0
- data/smoke/diagnostics/method_arity_mismatch.rb +2 -2
- data/smoke/diagnostics/method_parameter_mismatch.rb +10 -0
- data/smoke/diagnostics/test_expectations.yml +108 -57
- data/smoke/diagnostics-rbs/Steepfile +1 -1
- data/smoke/diagnostics-rbs/mixin-class-error.rbs +6 -0
- data/smoke/diagnostics-rbs/test_expectations.yml +12 -0
- data/smoke/diagnostics-rbs-duplicated/Steepfile +2 -1
- data/smoke/diagnostics-ruby-unsat/Steepfile +6 -0
- data/smoke/diagnostics-ruby-unsat/a.rbs +3 -0
- data/smoke/diagnostics-ruby-unsat/test_expectations.yml +27 -0
- data/smoke/{diagnostics → diagnostics-ruby-unsat}/unsatisfiable_constraint.rb +0 -1
- data/smoke/dstr/Steepfile +2 -1
- data/smoke/ensure/Steepfile +2 -1
- data/smoke/ensure/test_expectations.yml +3 -3
- data/smoke/enumerator/Steepfile +2 -1
- data/smoke/enumerator/test_expectations.yml +1 -1
- data/smoke/extension/Steepfile +2 -1
- data/smoke/hash/Steepfile +2 -1
- data/smoke/hello/Steepfile +2 -1
- data/smoke/if/Steepfile +2 -1
- data/smoke/implements/Steepfile +2 -1
- data/smoke/initialize/Steepfile +2 -1
- data/smoke/integer/Steepfile +2 -1
- data/smoke/interface/Steepfile +2 -1
- data/smoke/kwbegin/Steepfile +2 -1
- data/smoke/lambda/Steepfile +2 -1
- data/smoke/literal/Steepfile +2 -1
- data/smoke/literal/test_expectations.yml +2 -2
- data/smoke/map/Steepfile +2 -1
- data/smoke/method/Steepfile +2 -1
- data/smoke/method/test_expectations.yml +11 -10
- data/smoke/module/Steepfile +2 -1
- data/smoke/regexp/Steepfile +2 -1
- data/smoke/regression/Steepfile +2 -1
- data/smoke/regression/issue_372.rb +8 -0
- data/smoke/regression/issue_372.rbs +4 -0
- data/smoke/regression/test_expectations.yml +0 -12
- data/smoke/rescue/Steepfile +2 -1
- data/smoke/rescue/test_expectations.yml +3 -3
- data/smoke/self/Steepfile +2 -1
- data/smoke/skip/Steepfile +2 -1
- data/smoke/stdout/Steepfile +2 -1
- data/smoke/super/Steepfile +2 -1
- data/smoke/toplevel/Steepfile +2 -1
- data/smoke/toplevel/test_expectations.yml +3 -3
- data/smoke/tsort/Steepfile +4 -5
- data/smoke/tsort/test_expectations.yml +2 -2
- data/smoke/type_case/Steepfile +2 -1
- data/smoke/unexpected/Steepfile +2 -1
- data/smoke/yield/Steepfile +2 -1
- data/steep.gemspec +2 -2
- metadata +24 -10
@@ -229,3 +229,15 @@
|
|
229
229
|
severity: ERROR
|
230
230
|
message: Cannot find type `ZZZ`
|
231
231
|
code: RBS::UnknownTypeName
|
232
|
+
- file: mixin-class-error.rbs
|
233
|
+
diagnostics:
|
234
|
+
- range:
|
235
|
+
start:
|
236
|
+
line: 5
|
237
|
+
character: 2
|
238
|
+
end:
|
239
|
+
line: 5
|
240
|
+
character: 13
|
241
|
+
severity: ERROR
|
242
|
+
message: Cannot include a class `::Foo` in the definition of `::Bar`
|
243
|
+
code: RBS::MixinClassError
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
- file: unsatisfiable_constraint.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 3
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 6
|
10
|
+
character: 3
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Unsatisfiable constraint `::Array[untyped] <: A(2) <: ::String` is generated through (A(2)) { (A(2)) -> void } -> B(3)
|
14
|
+
::Array[untyped] <: ::String
|
15
|
+
::Object <: ::String
|
16
|
+
::BasicObject <: ::String
|
17
|
+
code: Ruby::UnsatisfiableConstraint
|
18
|
+
- range:
|
19
|
+
start:
|
20
|
+
line: 5
|
21
|
+
character: 4
|
22
|
+
end:
|
23
|
+
line: 5
|
24
|
+
character: 7
|
25
|
+
severity: ERROR
|
26
|
+
message: Type `::String` does not have method `foo`
|
27
|
+
code: Ruby::NoMethod
|
data/smoke/dstr/Steepfile
CHANGED
data/smoke/ensure/Steepfile
CHANGED
@@ -32,10 +32,10 @@
|
|
32
32
|
- range:
|
33
33
|
start:
|
34
34
|
line: 13
|
35
|
-
character:
|
35
|
+
character: 4
|
36
36
|
end:
|
37
|
-
line:
|
38
|
-
character:
|
37
|
+
line: 13
|
38
|
+
character: 7
|
39
39
|
severity: ERROR
|
40
40
|
message: |-
|
41
41
|
Cannot allow method body have type `::Integer` because declared as type `::String`
|
data/smoke/enumerator/Steepfile
CHANGED
@@ -102,7 +102,7 @@
|
|
102
102
|
Cannot find compatible overloading of method `with_object` of type `::Enumerator[::Integer, ::Array[::Integer]]`
|
103
103
|
Method types:
|
104
104
|
def with_object: [U] (U) { (::Integer, U) -> untyped } -> U
|
105
|
-
| [U] (U) -> ::Enumerator[[::Integer, U],
|
105
|
+
| [U] (U) -> ::Enumerator[[::Integer, U], U]
|
106
106
|
code: Ruby::UnresolvedOverloading
|
107
107
|
- range:
|
108
108
|
start:
|
data/smoke/extension/Steepfile
CHANGED
data/smoke/hash/Steepfile
CHANGED
data/smoke/hello/Steepfile
CHANGED
data/smoke/if/Steepfile
CHANGED
data/smoke/implements/Steepfile
CHANGED
data/smoke/initialize/Steepfile
CHANGED
data/smoke/integer/Steepfile
CHANGED
data/smoke/interface/Steepfile
CHANGED
data/smoke/kwbegin/Steepfile
CHANGED
data/smoke/lambda/Steepfile
CHANGED
data/smoke/literal/Steepfile
CHANGED
@@ -101,6 +101,6 @@
|
|
101
101
|
character: 15
|
102
102
|
severity: ERROR
|
103
103
|
message: |-
|
104
|
-
Cannot
|
104
|
+
Cannot pass a value of type `::Symbol` as an argument of type `:foo`
|
105
105
|
::Symbol <: :foo
|
106
|
-
code: Ruby::
|
106
|
+
code: Ruby::ArgumentTypeMismatch
|
data/smoke/map/Steepfile
CHANGED
data/smoke/method/Steepfile
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
- range:
|
5
5
|
start:
|
6
6
|
line: 3
|
7
|
-
character:
|
7
|
+
character: 4
|
8
8
|
end:
|
9
|
-
line:
|
10
|
-
character:
|
9
|
+
line: 3
|
10
|
+
character: 7
|
11
11
|
severity: ERROR
|
12
12
|
message: |-
|
13
13
|
Cannot allow method body have type `::Integer` because declared as type `::String`
|
@@ -49,13 +49,14 @@
|
|
49
49
|
- range:
|
50
50
|
start:
|
51
51
|
line: 15
|
52
|
-
character:
|
52
|
+
character: 11
|
53
53
|
end:
|
54
54
|
line: 15
|
55
|
-
character:
|
55
|
+
character: 12
|
56
56
|
severity: ERROR
|
57
|
-
message:
|
58
|
-
|
57
|
+
message: The method parameter is incompatible with the declaration `(::Integer)
|
58
|
+
-> ::String`
|
59
|
+
code: Ruby::MethodParameterMismatch
|
59
60
|
- range:
|
60
61
|
start:
|
61
62
|
line: 18
|
@@ -76,10 +77,10 @@
|
|
76
77
|
- range:
|
77
78
|
start:
|
78
79
|
line: 4
|
79
|
-
character:
|
80
|
+
character: 6
|
80
81
|
end:
|
81
|
-
line:
|
82
|
-
character:
|
82
|
+
line: 4
|
83
|
+
character: 9
|
83
84
|
severity: ERROR
|
84
85
|
message: |-
|
85
86
|
Cannot allow method body have type `::Symbol` because declared as type `(::Integer | ::String)`
|
data/smoke/module/Steepfile
CHANGED
data/smoke/regexp/Steepfile
CHANGED
data/smoke/regression/Steepfile
CHANGED
@@ -58,15 +58,3 @@
|
|
58
58
|
severity: ERROR
|
59
59
|
message: Type `::String` does not have method `ggggg`
|
60
60
|
code: Ruby::NoMethod
|
61
|
-
- file: thread.rb
|
62
|
-
diagnostics:
|
63
|
-
- range:
|
64
|
-
start:
|
65
|
-
line: 6
|
66
|
-
character: 13
|
67
|
-
end:
|
68
|
-
line: 7
|
69
|
-
character: 3
|
70
|
-
severity: ERROR
|
71
|
-
message: The method cannot be called with a block
|
72
|
-
code: Ruby::UnexpectedBlockGiven
|
data/smoke/rescue/Steepfile
CHANGED
@@ -64,10 +64,10 @@
|
|
64
64
|
- range:
|
65
65
|
start:
|
66
66
|
line: 37
|
67
|
-
character:
|
67
|
+
character: 4
|
68
68
|
end:
|
69
|
-
line:
|
70
|
-
character:
|
69
|
+
line: 37
|
70
|
+
character: 7
|
71
71
|
severity: ERROR
|
72
72
|
message: |-
|
73
73
|
Cannot allow method body have type `(::Integer | ::String)` because declared as type `::String`
|
data/smoke/self/Steepfile
CHANGED
data/smoke/skip/Steepfile
CHANGED
data/smoke/stdout/Steepfile
CHANGED