steep 1.3.0.pre.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/.github/workflows/ruby-windows.yml +1 -0
- data/.github/workflows/ruby.yml +1 -5
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +17 -14
- data/Gemfile.steep +2 -2
- data/Gemfile.steep.lock +5 -5
- data/bin/rbs +21 -0
- data/bin/setup +1 -1
- data/lib/steep/ast/types/class.rb +9 -3
- data/lib/steep/ast/types/factory.rb +9 -2
- data/lib/steep/ast/types/instance.rb +8 -3
- data/lib/steep/ast/types/intersection.rb +6 -2
- data/lib/steep/ast/types/literal.rb +1 -1
- data/lib/steep/ast/types/logic.rb +1 -3
- data/lib/steep/ast/types/name.rb +11 -5
- data/lib/steep/ast/types/proc.rb +5 -5
- data/lib/steep/ast/types/record.rb +5 -1
- data/lib/steep/ast/types/self.rb +8 -2
- data/lib/steep/ast/types/tuple.rb +7 -5
- data/lib/steep/ast/types/union.rb +10 -4
- data/lib/steep/ast/types/var.rb +1 -1
- data/lib/steep/index/rbs_index.rb +13 -6
- data/lib/steep/interface/substitution.rb +11 -10
- data/lib/steep/project/dsl.rb +12 -4
- data/lib/steep/project/options.rb +3 -1
- data/lib/steep/signature/validator.rb +13 -13
- data/lib/steep/type_inference/logic_type_interpreter.rb +2 -2
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +0 -1
- data/rbs_collection.steep.lock.yaml +44 -43
- data/sig/steep/ast/builtin.rbs +1 -1
- data/sig/steep/ast/types/any.rbs +5 -5
- data/sig/steep/ast/types/boolean.rbs +6 -6
- data/sig/steep/ast/types/bot.rbs +5 -5
- data/sig/steep/ast/types/class.rbs +7 -6
- data/sig/steep/ast/types/helper.rbs +2 -2
- data/sig/steep/ast/types/instance.rbs +6 -5
- data/sig/steep/ast/types/intersection.rbs +12 -9
- data/sig/steep/ast/types/literal.rbs +6 -4
- data/sig/steep/ast/types/logic.rbs +7 -9
- data/sig/steep/ast/types/name.rbs +7 -3
- data/sig/steep/ast/types/nil.rbs +6 -6
- data/sig/steep/ast/types/proc.rbs +8 -3
- data/sig/steep/ast/types/record.rbs +7 -8
- data/sig/steep/ast/types/self.rbs +7 -6
- data/sig/steep/ast/types/top.rbs +6 -6
- data/sig/steep/ast/types/tuple.rbs +5 -4
- data/sig/steep/ast/types/union.rbs +8 -8
- data/sig/steep/ast/types/var.rbs +16 -11
- data/sig/steep/ast/types/void.rbs +5 -5
- data/sig/steep/ast/types.rbs +5 -26
- data/sig/steep/index/rbs_index.rbs +83 -37
- data/sig/steep/interface/substitution.rbs +9 -9
- 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 +3 -2
- metadata +21 -7
- data/lib/steep/ast/types.rb +0 -62
@@ -2,15 +2,13 @@ module Steep
|
|
2
2
|
module AST
|
3
3
|
module Types
|
4
4
|
class Record
|
5
|
-
type loc = RBS::Location[untyped, untyped]
|
6
|
-
|
7
5
|
type key = Symbol | String | Integer
|
8
6
|
|
9
|
-
attr_reader location:
|
7
|
+
attr_reader location: untyped
|
10
8
|
|
11
9
|
attr_reader elements: Hash[key, t]
|
12
10
|
|
13
|
-
def initialize: (elements: Hash[key, t], ?location:
|
11
|
+
def initialize: (elements: Hash[key, t], ?location: untyped) -> void
|
14
12
|
|
15
13
|
def ==: (untyped other) -> bool
|
16
14
|
|
@@ -18,11 +16,12 @@ module Steep
|
|
18
16
|
|
19
17
|
alias eql? ==
|
20
18
|
|
21
|
-
def subst: (Interface::Substitution s) ->
|
19
|
+
def subst: (Interface::Substitution s) -> Record
|
22
20
|
|
23
|
-
def to_s: () ->
|
21
|
+
def to_s: () -> String
|
24
22
|
|
25
|
-
|
23
|
+
@fvs: Set[variable]
|
24
|
+
def free_variables: () -> Set[variable]
|
26
25
|
|
27
26
|
include Helper::ChildrenLevel
|
28
27
|
|
@@ -31,7 +30,7 @@ module Steep
|
|
31
30
|
|
32
31
|
def level: () -> Array[Integer]
|
33
32
|
|
34
|
-
def with_location: (
|
33
|
+
def with_location: (untyped new_location) -> Record
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
@@ -6,23 +6,24 @@ module Steep
|
|
6
6
|
|
7
7
|
def initialize: (?location: untyped?) -> void
|
8
8
|
|
9
|
-
def ==: (untyped other) ->
|
9
|
+
def ==: (untyped other) -> bool
|
10
10
|
|
11
|
-
def hash: () ->
|
11
|
+
def hash: () -> Integer
|
12
12
|
|
13
13
|
alias eql? ==
|
14
14
|
|
15
|
-
def to_s: () ->
|
15
|
+
def to_s: () -> String
|
16
16
|
|
17
17
|
include Helper::NoChild
|
18
18
|
|
19
|
-
def subst: (
|
19
|
+
def subst: (Interface::Substitution s) -> t
|
20
20
|
|
21
|
-
|
21
|
+
@@fvs: Set[variable]
|
22
|
+
def free_variables: () -> Set[variable]
|
22
23
|
|
23
24
|
def level: () -> Array[Integer]
|
24
25
|
|
25
|
-
def with_location: (untyped new_location) ->
|
26
|
+
def with_location: (untyped new_location) -> Self
|
26
27
|
|
27
28
|
self.@instance: Self
|
28
29
|
def self.instance: () -> Self
|
data/sig/steep/ast/types/top.rbs
CHANGED
@@ -6,23 +6,23 @@ module Steep
|
|
6
6
|
|
7
7
|
def initialize: (?location: untyped?) -> void
|
8
8
|
|
9
|
-
def ==: (untyped other) ->
|
9
|
+
def ==: (untyped other) -> bool
|
10
10
|
|
11
|
-
def hash: () ->
|
11
|
+
def hash: () -> Integer
|
12
12
|
|
13
13
|
alias eql? ==
|
14
14
|
|
15
|
-
def subst: (
|
15
|
+
def subst: (Interface::Substitution s) -> Top
|
16
16
|
|
17
|
-
def to_s: () ->
|
17
|
+
def to_s: () -> String
|
18
18
|
|
19
19
|
include Helper::NoFreeVariables
|
20
20
|
|
21
21
|
include Helper::NoChild
|
22
22
|
|
23
23
|
def level: () -> Array[Integer]
|
24
|
-
|
25
|
-
def with_location: (untyped new_location) ->
|
24
|
+
|
25
|
+
def with_location: (untyped new_location) -> Top
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -4,9 +4,9 @@ module Steep
|
|
4
4
|
class Tuple
|
5
5
|
attr_reader types: Array[t]
|
6
6
|
|
7
|
-
attr_reader location:
|
7
|
+
attr_reader location: untyped
|
8
8
|
|
9
|
-
def initialize: (types: Array[t], ?location:
|
9
|
+
def initialize: (types: Array[t], ?location: untyped) -> void
|
10
10
|
|
11
11
|
def ==: (untyped other) -> bool
|
12
12
|
|
@@ -18,7 +18,8 @@ module Steep
|
|
18
18
|
|
19
19
|
def to_s: () -> ::String
|
20
20
|
|
21
|
-
|
21
|
+
@fvs: Set[variable]
|
22
|
+
def free_variables: () -> Set[variable]
|
22
23
|
|
23
24
|
include Helper::ChildrenLevel
|
24
25
|
|
@@ -27,7 +28,7 @@ module Steep
|
|
27
28
|
|
28
29
|
def level: () -> Array[Integer]
|
29
30
|
|
30
|
-
def with_location: (
|
31
|
+
def with_location: (untyped new_location) -> Tuple
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
@@ -4,25 +4,25 @@ module Steep
|
|
4
4
|
class Union
|
5
5
|
attr_reader types: Array[t]
|
6
6
|
|
7
|
-
|
7
|
+
attr_reader location: untyped
|
8
8
|
|
9
|
-
|
9
|
+
def initialize: (types: Array[t], ?location: untyped) -> void
|
10
10
|
|
11
|
-
def
|
12
|
-
|
13
|
-
def self.build: (types: Array[t], ?location: loc?) -> t
|
11
|
+
def self.build: (types: Array[t], ?location: untyped) -> t
|
14
12
|
|
15
13
|
def ==: (untyped other) -> bool
|
16
14
|
|
15
|
+
@hash: Integer
|
17
16
|
def hash: () -> Integer
|
18
17
|
|
19
18
|
alias eql? ==
|
20
19
|
|
21
|
-
def subst: (Interface::Substitution s) ->
|
20
|
+
def subst: (Interface::Substitution s) -> t
|
22
21
|
|
23
22
|
def to_s: () -> ::String
|
24
23
|
|
25
|
-
|
24
|
+
@fvs: Set[variable]
|
25
|
+
def free_variables: () -> Set[variable]
|
26
26
|
|
27
27
|
def each_child: () { (t) -> void } -> void
|
28
28
|
| () -> Enumerator[t, void]
|
@@ -31,7 +31,7 @@ module Steep
|
|
31
31
|
|
32
32
|
def level: () -> Array[Integer]
|
33
33
|
|
34
|
-
def with_location: (
|
34
|
+
def with_location: (untyped new_location) -> Union
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
data/sig/steep/ast/types/var.rbs
CHANGED
@@ -1,36 +1,41 @@
|
|
1
1
|
module Steep
|
2
2
|
module AST
|
3
3
|
module Types
|
4
|
+
# Type variables
|
4
5
|
class Var
|
5
|
-
attr_reader name:
|
6
|
+
attr_reader name: Symbol
|
6
7
|
|
7
8
|
attr_reader location: untyped
|
8
9
|
|
9
|
-
def initialize: (name:
|
10
|
+
def initialize: (name: Symbol, ?location: untyped?) -> void
|
10
11
|
|
11
|
-
def ==: (untyped other) ->
|
12
|
+
def ==: (untyped other) -> bool
|
12
13
|
|
13
|
-
def hash: () ->
|
14
|
+
def hash: () -> Integer
|
14
15
|
|
15
16
|
alias eql? ==
|
16
17
|
|
17
|
-
|
18
|
+
self.@mutex: Thread::Mutex
|
19
|
+
self.@max: Integer
|
20
|
+
|
21
|
+
def self.fresh_name: (Symbol name) -> Symbol
|
18
22
|
|
19
23
|
def self.fresh: (Symbol name, ?location: untyped?) -> Var
|
20
24
|
|
21
|
-
def to_s: () ->
|
25
|
+
def to_s: () -> String
|
22
26
|
|
23
|
-
def subst: (
|
27
|
+
def subst: (Interface::Substitution s) -> t
|
24
28
|
|
25
|
-
|
29
|
+
@fvs: Set[variable]
|
30
|
+
def free_variables: () -> Set[variable]
|
26
31
|
|
27
32
|
include Helper::NoChild
|
28
33
|
|
29
34
|
def level: () -> Array[Integer]
|
30
|
-
|
31
|
-
def update: (?name: untyped, ?location: untyped) -> untyped
|
32
35
|
|
33
|
-
def
|
36
|
+
def update: (?name: Symbol, ?location: untyped) -> Var
|
37
|
+
|
38
|
+
def with_location: (untyped new_location) -> Var
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
@@ -6,15 +6,15 @@ module Steep
|
|
6
6
|
|
7
7
|
def initialize: (?location: untyped?) -> void
|
8
8
|
|
9
|
-
def ==: (untyped other) ->
|
9
|
+
def ==: (untyped other) -> bool
|
10
10
|
|
11
|
-
def hash: () ->
|
11
|
+
def hash: () -> Integer
|
12
12
|
|
13
13
|
alias eql? ==
|
14
14
|
|
15
|
-
def subst: (
|
15
|
+
def subst: (Interface::Substitution s) -> Void
|
16
16
|
|
17
|
-
def to_s: () ->
|
17
|
+
def to_s: () -> String
|
18
18
|
|
19
19
|
include Helper::NoFreeVariables
|
20
20
|
|
@@ -22,7 +22,7 @@ module Steep
|
|
22
22
|
|
23
23
|
def level: () -> Array[Integer]
|
24
24
|
|
25
|
-
def with_location: (untyped new_location) ->
|
25
|
+
def with_location: (untyped new_location) -> Void
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/sig/steep/ast/types.rbs
CHANGED
@@ -5,33 +5,12 @@ module Steep
|
|
5
5
|
| Class | Instance | Self
|
6
6
|
| Intersection | Record | Tuple | Union
|
7
7
|
| Name::Alias | Name::Instance | Name::Interface | Name::Singleton
|
8
|
-
| Proc | Var
|
8
|
+
| Proc | Var
|
9
|
+
| Logic::Not | Logic::ReceiverIsNil | Logic::ReceiverIsNotNil | Logic::ReceiverIsArg | Logic::ArgIsReceiver | Logic::ArgEqualsReceiver | Logic::Env
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
attr_reader type: untyped
|
14
|
-
|
15
|
-
attr_reader mask: untyped
|
16
|
-
|
17
|
-
def initialize: (type: untyped, mask: untyped, location: untyped) -> void
|
18
|
-
|
19
|
-
def ==: (untyped other) -> untyped
|
20
|
-
|
21
|
-
alias eql? ==
|
22
|
-
|
23
|
-
def hash: () -> untyped
|
24
|
-
|
25
|
-
def to_json: (*untyped a) -> untyped
|
26
|
-
|
27
|
-
def to_s: (?::Integer level) -> ::String
|
28
|
-
|
29
|
-
def free_variables: () -> untyped
|
30
|
-
|
31
|
-
def each_type: () { (untyped) -> untyped } -> untyped
|
32
|
-
|
33
|
-
def sub: (untyped s) -> untyped
|
34
|
-
end
|
11
|
+
# Variables and special types that is subject for substitution
|
12
|
+
#
|
13
|
+
type variable = Symbol | Class | Instance | Self
|
35
14
|
end
|
36
15
|
end
|
37
16
|
end
|
@@ -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
|
@@ -2,28 +2,28 @@ module Steep
|
|
2
2
|
module Interface
|
3
3
|
class Substitution
|
4
4
|
class InvalidSubstitutionError < StandardError
|
5
|
-
attr_reader vars_size:
|
5
|
+
attr_reader vars_size: Integer
|
6
6
|
|
7
|
-
attr_reader types_size:
|
7
|
+
attr_reader types_size: Integer
|
8
8
|
|
9
|
-
def initialize: (vars_size:
|
9
|
+
def initialize: (vars_size: Integer, types_size: Integer) -> void
|
10
10
|
end
|
11
11
|
|
12
12
|
attr_reader dictionary: Hash[Symbol, AST::Types::t]
|
13
13
|
|
14
|
-
attr_reader instance_type: AST::Types::t
|
14
|
+
attr_reader instance_type: AST::Types::t?
|
15
15
|
|
16
|
-
attr_reader module_type: AST::Types::t
|
16
|
+
attr_reader module_type: AST::Types::t?
|
17
17
|
|
18
|
-
attr_reader self_type: AST::Types::t
|
18
|
+
attr_reader self_type: AST::Types::t?
|
19
19
|
|
20
|
-
def initialize: (dictionary: Hash[Symbol, AST::Types::t], instance_type: AST::Types::t
|
20
|
+
def initialize: (dictionary: Hash[Symbol, AST::Types::t], instance_type: AST::Types::t?, module_type: AST::Types::t?, self_type: AST::Types::t?) -> void
|
21
21
|
|
22
22
|
def self.empty: () -> instance
|
23
23
|
|
24
24
|
def empty?: () -> bool
|
25
25
|
|
26
|
-
def domain: () -> Set[AST::Types::
|
26
|
+
def domain: () -> Set[AST::Types::variable]
|
27
27
|
|
28
28
|
def to_s: () -> ::String
|
29
29
|
|
@@ -31,7 +31,7 @@ module Steep
|
|
31
31
|
|
32
32
|
def key?: (Symbol var) -> bool
|
33
33
|
|
34
|
-
def self.build: (Array[Symbol] vars, ?Array[AST::Types::t]? types, ?instance_type: AST::Types::t
|
34
|
+
def self.build: (Array[Symbol] vars, ?Array[AST::Types::t]? types, ?instance_type: AST::Types::t?, ?module_type: AST::Types::t?, ?self_type: AST::Types::t?) -> Substitution
|
35
35
|
|
36
36
|
def except: (Array[Symbol] vars) -> Substitution
|
37
37
|
|
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
|