steep 1.0.2 → 1.1.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +22 -3
- data/Gemfile +6 -3
- data/Gemfile.lock +12 -16
- data/Gemfile.steep +3 -0
- data/Gemfile.steep.lock +49 -0
- data/Rakefile +5 -0
- data/Steepfile +6 -1
- data/bin/setup +2 -0
- data/bin/steep +19 -0
- data/lib/steep/ast/types/factory.rb +1 -1
- data/lib/steep/diagnostic/ruby.rb +49 -3
- data/lib/steep/diagnostic/signature.rb +18 -0
- data/lib/steep/drivers/watch.rb +3 -1
- data/lib/steep/method_name.rb +9 -3
- data/lib/steep/node_helper.rb +49 -0
- data/lib/steep/services/completion_provider.rb +22 -15
- data/lib/steep/services/hover_provider/ruby.rb +30 -12
- data/lib/steep/services/type_check_service.rb +12 -12
- data/lib/steep/shims/symbol_start_with.rb +18 -0
- data/lib/steep/signature/validator.rb +19 -0
- data/lib/steep/subtyping/constraints.rb +43 -14
- data/lib/steep/type_construction.rb +666 -746
- data/lib/steep/type_inference/constant_env.rb +0 -2
- data/lib/steep/type_inference/context.rb +23 -17
- data/lib/steep/type_inference/logic_type_interpreter.rb +210 -119
- data/lib/steep/type_inference/method_call.rb +80 -6
- data/lib/steep/type_inference/multiple_assignment.rb +189 -0
- data/lib/steep/type_inference/type_env.rb +271 -120
- data/lib/steep/type_inference/type_env_builder.rb +138 -0
- data/lib/steep/typing.rb +2 -0
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +4 -3
- data/rbs_collection.steep.lock.yaml +112 -0
- data/rbs_collection.steep.yaml +19 -0
- data/sample/sig/conference.rbs +8 -0
- data/sig/shims/parser/source/map.rbs +146 -0
- data/sig/shims/parser/source/range.rbs +237 -0
- data/sig/shims/parser.rbs +17 -0
- data/sig/steep/ast/annotation/collection.rbs +75 -0
- data/sig/steep/ast/annotation.rbs +126 -0
- data/sig/steep/ast/builtin.rbs +69 -0
- data/sig/steep/ast/type_params.rbs +11 -0
- data/sig/steep/ast/types/any.rbs +29 -0
- data/sig/steep/ast/types/boolean.rbs +31 -0
- data/sig/steep/ast/types/bot.rbs +29 -0
- data/sig/steep/ast/types/class.rbs +29 -0
- data/sig/steep/ast/types/factory.rbs +76 -0
- data/sig/steep/ast/types/helper.rbs +19 -0
- data/sig/steep/ast/types/instance.rbs +29 -0
- data/sig/steep/ast/types/intersection.rbs +35 -0
- data/sig/steep/ast/types/literal.rbs +33 -0
- data/sig/steep/ast/types/logic.rbs +78 -0
- data/sig/steep/ast/types/name.rbs +71 -0
- data/sig/steep/ast/types/nil.rbs +31 -0
- data/sig/steep/ast/types/proc.rbs +46 -0
- data/sig/steep/ast/types/record.rbs +38 -0
- data/sig/steep/ast/types/self.rbs +29 -0
- data/sig/steep/ast/types/top.rbs +29 -0
- data/sig/steep/ast/types/tuple.rbs +34 -0
- data/sig/steep/ast/types/union.rbs +38 -0
- data/sig/steep/ast/types/var.rbs +37 -0
- data/sig/steep/ast/types/void.rbs +29 -0
- data/sig/steep/ast/types.rbs +37 -0
- data/sig/steep/diagnostic/deprecated/unknown_constant_assigned.rbs +15 -0
- data/sig/steep/diagnostic/helper.rbs +9 -0
- data/sig/steep/diagnostic/lsp_formatter.rbs +29 -0
- data/sig/steep/diagnostic/ruby.rbs +494 -0
- data/sig/steep/diagnostic/signature.rbs +215 -0
- data/sig/steep/interface/block.rbs +35 -0
- data/sig/steep/interface/function.rbs +253 -0
- data/sig/steep/interface/interface.rbs +23 -0
- data/sig/steep/interface/method_type.rbs +55 -0
- data/sig/steep/interface/substitution.rbs +53 -0
- data/sig/steep/interface/type_param.rbs +35 -0
- data/sig/steep/method_name.rbs +26 -0
- data/sig/steep/module_helper.rbs +7 -0
- data/sig/steep/node_helper.rbs +11 -0
- data/sig/steep/project/dsl.rbs +94 -0
- data/sig/steep/project/options.rbs +15 -0
- data/sig/steep/project/pattern.rbs +25 -0
- data/sig/steep/project/target.rbs +25 -0
- data/sig/steep/project.rbs +19 -0
- data/sig/steep/services/completion_provider.rbs +123 -0
- data/sig/steep/services/content_change.rbs +35 -0
- data/sig/steep/services/file_loader.rbs +13 -0
- data/sig/steep/services/goto_service.rbs +45 -0
- data/sig/steep/services/hover_provider/rbs.rbs +21 -0
- data/sig/steep/services/hover_provider/ruby.rbs +109 -0
- data/sig/steep/services/hover_provider/singleton_methods.rbs +11 -0
- data/sig/steep/services/path_assignment.rbs +21 -0
- data/sig/steep/services/signature_service.rbs +91 -0
- data/sig/steep/services/stats_calculator.rbs +17 -0
- data/sig/steep/services/type_check_service.rbs +93 -0
- data/sig/steep/source.rbs +55 -0
- data/sig/steep/subtyping/cache.rbs +17 -0
- data/sig/steep/subtyping/check.rbs +93 -0
- data/sig/steep/subtyping/constraints.rbs +111 -0
- data/sig/steep/subtyping/relation.rbs +51 -0
- data/sig/steep/subtyping/result.rbs +157 -0
- data/sig/steep/subtyping/variable_variance.rbs +23 -0
- data/sig/steep/type_construction.rbs +285 -0
- data/sig/steep/type_inference/block_params.rbs +52 -0
- data/sig/steep/type_inference/constant_env.rbs +27 -0
- data/sig/steep/type_inference/context.rbs +137 -0
- data/sig/steep/type_inference/logic_type_interpreter.rbs +72 -0
- data/sig/steep/type_inference/method_call.rbs +124 -0
- data/sig/steep/type_inference/method_params.rbs +104 -0
- data/sig/steep/type_inference/multiple_assignment.rbs +76 -0
- data/sig/steep/type_inference/type_env.rbs +158 -0
- data/sig/steep/type_inference/type_env_builder.rbs +77 -0
- data/sig/steep/typing.rbs +68 -0
- data/sig/steep.rbs +31 -0
- data/smoke/class/f.rb +1 -0
- data/smoke/class/test_expectations.yml +2 -2
- data/smoke/diagnostics/test_expectations.yml +4 -2
- metadata +90 -6
- data/lib/steep/type_inference/local_variable_type_env.rb +0 -249
- data/lib/steep/type_inference/logic.rb +0 -161
@@ -0,0 +1,123 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class CompletionProvider
|
4
|
+
class Position
|
5
|
+
attr_reader line: Integer
|
6
|
+
|
7
|
+
attr_reader column: Integer
|
8
|
+
|
9
|
+
def initialize: (line: Integer, column: Integer) -> void
|
10
|
+
|
11
|
+
def -: (Integer) -> Position
|
12
|
+
end
|
13
|
+
|
14
|
+
class Range
|
15
|
+
attr_reader start: Position
|
16
|
+
|
17
|
+
attr_reader end: Position
|
18
|
+
|
19
|
+
def initialize: (start: Position, end: Position) -> void
|
20
|
+
end
|
21
|
+
|
22
|
+
class InstanceVariableItem
|
23
|
+
attr_reader identifier: Symbol
|
24
|
+
|
25
|
+
attr_reader range: Range
|
26
|
+
|
27
|
+
attr_reader type: AST::Types::t
|
28
|
+
|
29
|
+
def initialize: (identifier: Symbol, range: Range, type: AST::Types::t) -> void
|
30
|
+
end
|
31
|
+
|
32
|
+
class LocalVariableItem
|
33
|
+
attr_reader identifier: Symbol
|
34
|
+
|
35
|
+
attr_reader range: Range
|
36
|
+
|
37
|
+
attr_reader type: AST::Types::t
|
38
|
+
|
39
|
+
def initialize: (identifier: Symbol, range: Range, type: AST::Types::t) -> void
|
40
|
+
end
|
41
|
+
|
42
|
+
class ConstantItem
|
43
|
+
attr_reader env: RBS::Environment
|
44
|
+
|
45
|
+
attr_reader identifier: Symbol
|
46
|
+
|
47
|
+
attr_reader range: Range
|
48
|
+
|
49
|
+
attr_reader type: AST::Types::t
|
50
|
+
|
51
|
+
attr_reader full_name: RBS::TypeName
|
52
|
+
|
53
|
+
def initialize: (env: RBS::Environment, identifier: Symbol, range: Range, type: AST::Types::t, full_name: RBS::TypeName) -> void
|
54
|
+
end
|
55
|
+
|
56
|
+
class MethodNameItem
|
57
|
+
attr_reader identifier: Symbol
|
58
|
+
|
59
|
+
attr_reader range: Range
|
60
|
+
|
61
|
+
attr_reader receiver_type: AST::Types::t
|
62
|
+
|
63
|
+
attr_reader method_type: untyped
|
64
|
+
|
65
|
+
attr_reader method_decls: Array[TypeInference::MethodCall::MethodDecl]
|
66
|
+
|
67
|
+
def initialize: (identifier: Symbol, range: Range, method_type: untyped, method_decls: Array[TypeInference::MethodCall::MethodDecl]) -> void
|
68
|
+
|
69
|
+
def comment: () -> RBS::AST::Comment?
|
70
|
+
|
71
|
+
def inherited?: () -> bool
|
72
|
+
end
|
73
|
+
|
74
|
+
attr_reader source_text: untyped
|
75
|
+
|
76
|
+
attr_reader path: untyped
|
77
|
+
|
78
|
+
attr_reader subtyping: untyped
|
79
|
+
|
80
|
+
attr_reader modified_text: untyped
|
81
|
+
|
82
|
+
attr_reader source: untyped
|
83
|
+
|
84
|
+
attr_reader typing: Typing
|
85
|
+
|
86
|
+
def initialize: (source_text: untyped, path: untyped, subtyping: untyped) -> void
|
87
|
+
|
88
|
+
def type_check!: (untyped text, line: untyped, column: untyped) -> untyped
|
89
|
+
|
90
|
+
def env: () -> untyped
|
91
|
+
|
92
|
+
def run: (line: untyped, column: untyped) -> untyped
|
93
|
+
|
94
|
+
def range_from_loc: (untyped loc) -> untyped
|
95
|
+
|
96
|
+
def at_end?: (untyped pos, of: untyped) -> (untyped | nil)
|
97
|
+
|
98
|
+
def range_for: (untyped position, ?prefix: ::String) -> untyped
|
99
|
+
|
100
|
+
def items_for_trigger: (position: untyped) -> (::Array[untyped] | untyped)
|
101
|
+
|
102
|
+
def items_for_dot: (position: Position) -> ::Array[MethodNameItem]
|
103
|
+
|
104
|
+
def items_for_colon2: (position: untyped) -> untyped
|
105
|
+
|
106
|
+
def items_for_atmark: (position: untyped) -> (::Array[untyped] | untyped)
|
107
|
+
|
108
|
+
def method_items_for_receiver_type: (untyped `type`, include_private: untyped, prefix: untyped, position: untyped, items: untyped) -> untyped
|
109
|
+
|
110
|
+
def word_name?: (String name) -> void
|
111
|
+
|
112
|
+
def local_variable_items_for_context: (TypeInference::Context context, position: Position, prefix: String, items: Array[LocalVariableItem]) -> void
|
113
|
+
|
114
|
+
def constant_items_for_context: (TypeInference::Context context, position: Position, prefix: String, items: Array[ConstantItem], ?parent: Parser::AST::Node?) -> void
|
115
|
+
|
116
|
+
def instance_variable_items_for_context: (TypeInference::Context context, position: Position, prefix: String, items: Array[InstanceVariableItem]) -> void
|
117
|
+
|
118
|
+
def index_for: (untyped string, line: untyped, column: untyped) -> untyped
|
119
|
+
|
120
|
+
def disallowed_method?: (Symbol name) -> bool
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class ContentChange
|
4
|
+
class Position
|
5
|
+
attr_reader line: untyped
|
6
|
+
|
7
|
+
attr_reader column: untyped
|
8
|
+
|
9
|
+
def initialize: (line: untyped, column: untyped) -> void
|
10
|
+
|
11
|
+
def ==: (untyped other) -> untyped
|
12
|
+
|
13
|
+
alias eql? ==
|
14
|
+
|
15
|
+
def hash: () -> untyped
|
16
|
+
end
|
17
|
+
|
18
|
+
attr_reader range: untyped
|
19
|
+
|
20
|
+
attr_reader text: untyped
|
21
|
+
|
22
|
+
def initialize: (text: untyped, ?range: untyped?) -> void
|
23
|
+
|
24
|
+
def ==: (untyped other) -> untyped
|
25
|
+
|
26
|
+
alias eql? ==
|
27
|
+
|
28
|
+
def hash: () -> untyped
|
29
|
+
|
30
|
+
def self.string: (untyped string) -> untyped
|
31
|
+
|
32
|
+
def apply_to: (untyped text) -> untyped
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class FileLoader
|
4
|
+
attr_reader base_dir: untyped
|
5
|
+
|
6
|
+
def initialize: (base_dir: untyped) -> void
|
7
|
+
|
8
|
+
def each_path_in_patterns: (untyped pattern, ?untyped commandline_patterns) { (untyped) -> untyped } -> untyped
|
9
|
+
|
10
|
+
def load_changes: (untyped pattern, ?untyped command_line_patterns, changes: untyped) -> untyped
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class GotoService
|
4
|
+
include ModuleHelper
|
5
|
+
|
6
|
+
module SourceHelper
|
7
|
+
def from_ruby?: () -> untyped
|
8
|
+
|
9
|
+
def from_rbs?: () -> untyped
|
10
|
+
end
|
11
|
+
|
12
|
+
ConstantQuery: untyped
|
13
|
+
|
14
|
+
MethodQuery: untyped
|
15
|
+
|
16
|
+
TypeNameQuery: untyped
|
17
|
+
|
18
|
+
attr_reader type_check: untyped
|
19
|
+
|
20
|
+
attr_reader assignment: untyped
|
21
|
+
|
22
|
+
def initialize: (type_check: untyped, assignment: untyped) -> void
|
23
|
+
|
24
|
+
def project: () -> untyped
|
25
|
+
|
26
|
+
def implementation: (path: untyped, line: untyped, column: untyped) -> untyped
|
27
|
+
|
28
|
+
def definition: (path: untyped, line: untyped, column: untyped) -> untyped
|
29
|
+
|
30
|
+
def test_ast_location: (untyped loc, line: untyped, column: untyped) -> (false | true)
|
31
|
+
|
32
|
+
def query_at: (path: untyped, line: untyped, column: untyped) -> untyped
|
33
|
+
|
34
|
+
def type_check_path: (target: untyped, path: untyped, content: untyped, line: untyped, column: untyped) -> untyped
|
35
|
+
|
36
|
+
def constant_definition_in_rbs: (untyped name, locations: untyped) -> untyped
|
37
|
+
|
38
|
+
def constant_definition_in_ruby: (untyped name, locations: untyped) -> untyped
|
39
|
+
|
40
|
+
def method_locations: (untyped name, in_ruby: untyped, in_rbs: untyped, locations: untyped) -> untyped
|
41
|
+
|
42
|
+
def type_name_locations: (untyped name, ?locations: untyped) -> untyped
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
module HoverProvider
|
4
|
+
class RBS
|
5
|
+
TypeAliasContent: untyped
|
6
|
+
|
7
|
+
ClassContent: untyped
|
8
|
+
|
9
|
+
InterfaceContent: untyped
|
10
|
+
|
11
|
+
attr_reader service: untyped
|
12
|
+
|
13
|
+
def initialize: (service: untyped) -> void
|
14
|
+
|
15
|
+
def project: () -> untyped
|
16
|
+
|
17
|
+
def content_for: (target: untyped, path: untyped, line: untyped, column: untyped) -> (nil | untyped)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
module HoverProvider
|
4
|
+
class Ruby
|
5
|
+
class TypeContent
|
6
|
+
attr_reader node: Parser::AST::Node
|
7
|
+
|
8
|
+
attr_reader type: AST::Types::t
|
9
|
+
|
10
|
+
attr_reader location: Parser::Source::Range
|
11
|
+
|
12
|
+
def initialize: (node: Parser::AST::Node, type: AST::Types::t, location: Parser::Source::Range) -> void
|
13
|
+
end
|
14
|
+
|
15
|
+
# Hover content for a local variable, references or assignments
|
16
|
+
#
|
17
|
+
# ```ruby
|
18
|
+
# a = 123
|
19
|
+
# # ^^^^ Hover popups
|
20
|
+
# # ^ Location covers
|
21
|
+
#
|
22
|
+
# a + 1
|
23
|
+
# # ^ Hover popups
|
24
|
+
# # ^ Location covers
|
25
|
+
# ```
|
26
|
+
class VariableContent
|
27
|
+
attr_reader node: Parser::AST::Node
|
28
|
+
|
29
|
+
attr_reader name: Symbol
|
30
|
+
|
31
|
+
attr_reader type: AST::Types::t
|
32
|
+
|
33
|
+
attr_reader location: Parser::Source::Range
|
34
|
+
|
35
|
+
def initialize: (node: Parser::AST::Node, name: Symbol, type: AST::Types::t, location: Parser::Source::Range) -> void
|
36
|
+
end
|
37
|
+
|
38
|
+
class MethodCallContent
|
39
|
+
attr_reader node: Parser::AST::Node
|
40
|
+
|
41
|
+
attr_reader method_call: TypeInference::MethodCall::t
|
42
|
+
|
43
|
+
attr_reader location: Parser::Source::Range
|
44
|
+
|
45
|
+
def initialize: (node: Parser::AST::Node, method_call: TypeInference::MethodCall::t, location: Parser::Source::Range) -> void
|
46
|
+
end
|
47
|
+
|
48
|
+
class DefinitionContent
|
49
|
+
attr_reader node: Parser::AST::Node
|
50
|
+
|
51
|
+
attr_reader method_name: method_name
|
52
|
+
|
53
|
+
attr_reader method_type: Interface::MethodType
|
54
|
+
|
55
|
+
attr_reader definition: ::RBS::Definition::Method
|
56
|
+
|
57
|
+
attr_reader location: Parser::Source::Range
|
58
|
+
|
59
|
+
def initialize: (node: Parser::AST::Node, method_name: method_name, method_type: Interface::MethodType, definition: ::RBS::Definition::Method, location: Parser::Source::Range) -> void
|
60
|
+
end
|
61
|
+
|
62
|
+
class ConstantContent
|
63
|
+
attr_reader location: Parser::Source::Range
|
64
|
+
|
65
|
+
attr_reader full_name: ::RBS::TypeName
|
66
|
+
|
67
|
+
attr_reader type: AST::Types::t
|
68
|
+
|
69
|
+
type decl = ::RBS::Environment::ClassEntry
|
70
|
+
| ::RBS::Environment::ModuleEntry
|
71
|
+
| ::RBS::Environment::SingleEntry[::RBS::TypeName, ::RBS::AST::Declarations::Constant]
|
72
|
+
|
73
|
+
attr_reader decl: decl
|
74
|
+
|
75
|
+
attr_reader class_decl(): ::RBS::Environment::ClassEntry | ::RBS::Environment::ModuleEntry | nil
|
76
|
+
|
77
|
+
attr_reader constant_decl(): ::RBS::Environment::SingleEntry[::RBS::TypeName, ::RBS::AST::Declarations::Constant]?
|
78
|
+
|
79
|
+
def initialize: (location: Parser::Source::Range, full_name: ::RBS::TypeName, type: AST::Types::t, decl: decl) -> void
|
80
|
+
|
81
|
+
def comments: () -> Array[::RBS::AST::Comment]
|
82
|
+
|
83
|
+
# Returns true if `decl` is a class/module definition
|
84
|
+
def class_or_module?: () -> bool
|
85
|
+
|
86
|
+
# Returns true if `decl` is a constant definition
|
87
|
+
def constant?: () -> bool
|
88
|
+
end
|
89
|
+
|
90
|
+
type content = TypeContent | VariableContent | MethodCallContent | DefinitionContent | ConstantContent
|
91
|
+
|
92
|
+
attr_reader service: TypeCheckService
|
93
|
+
|
94
|
+
def initialize: (service: TypeCheckService) -> void
|
95
|
+
|
96
|
+
def project: () -> Project
|
97
|
+
|
98
|
+
def method_definition_for: (AST::Types::Factory factory, ::RBS::TypeName type_name, singleton_method: Symbol) -> ::RBS::Definition::Method
|
99
|
+
| (AST::Types::Factory factory, ::RBS::TypeName type_name, instance_method: Symbol) -> ::RBS::Definition::Method
|
100
|
+
|
101
|
+
def typecheck: (Project::Target target, path: Pathname, content: String, line: Integer, column: Integer) -> Typing?
|
102
|
+
|
103
|
+
def method_name_from_method: (TypeInference::Context::MethodContext context, builder: ::RBS::DefinitionBuilder) -> method_name
|
104
|
+
|
105
|
+
def content_for: (target: Project::Target, path: Pathname, line: Integer, column: Integer) -> content?
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class PathAssignment
|
4
|
+
attr_reader index: untyped
|
5
|
+
|
6
|
+
attr_reader max_index: untyped
|
7
|
+
|
8
|
+
attr_reader cache: untyped
|
9
|
+
|
10
|
+
def initialize: (index: untyped, max_index: untyped) -> void
|
11
|
+
|
12
|
+
def self.all: () -> untyped
|
13
|
+
|
14
|
+
def =~: (untyped path) -> untyped
|
15
|
+
|
16
|
+
alias === =~
|
17
|
+
|
18
|
+
def self.index_for: (path: untyped, max_index: untyped) -> untyped
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class SignatureService
|
4
|
+
attr_reader status: untyped
|
5
|
+
|
6
|
+
class SyntaxErrorStatus
|
7
|
+
attr_reader files: untyped
|
8
|
+
|
9
|
+
attr_reader changed_paths: untyped
|
10
|
+
|
11
|
+
attr_reader diagnostics: untyped
|
12
|
+
|
13
|
+
attr_reader last_builder: untyped
|
14
|
+
|
15
|
+
def initialize: (files: untyped, changed_paths: untyped, diagnostics: untyped, last_builder: untyped) -> void
|
16
|
+
|
17
|
+
def rbs_index: () -> untyped
|
18
|
+
end
|
19
|
+
|
20
|
+
class AncestorErrorStatus
|
21
|
+
attr_reader files: untyped
|
22
|
+
|
23
|
+
attr_reader changed_paths: untyped
|
24
|
+
|
25
|
+
attr_reader diagnostics: untyped
|
26
|
+
|
27
|
+
attr_reader last_builder: untyped
|
28
|
+
|
29
|
+
def initialize: (files: untyped, changed_paths: untyped, diagnostics: untyped, last_builder: untyped) -> void
|
30
|
+
|
31
|
+
def rbs_index: () -> untyped
|
32
|
+
end
|
33
|
+
|
34
|
+
class LoadedStatus
|
35
|
+
attr_reader files: untyped
|
36
|
+
|
37
|
+
attr_reader builder: untyped
|
38
|
+
|
39
|
+
def initialize: (files: untyped, builder: untyped) -> void
|
40
|
+
|
41
|
+
def subtyping: () -> untyped
|
42
|
+
|
43
|
+
def rbs_index: () -> untyped
|
44
|
+
end
|
45
|
+
|
46
|
+
FileStatus: untyped
|
47
|
+
|
48
|
+
def initialize: (env: untyped) -> void
|
49
|
+
|
50
|
+
def self.load_from: (untyped loader) -> untyped
|
51
|
+
|
52
|
+
def env_rbs_paths: () -> untyped
|
53
|
+
|
54
|
+
def each_rbs_path: () { (untyped) -> untyped } -> untyped
|
55
|
+
|
56
|
+
def files: () -> untyped
|
57
|
+
|
58
|
+
def pending_changed_paths: () -> untyped
|
59
|
+
|
60
|
+
def latest_env: () -> untyped
|
61
|
+
|
62
|
+
def latest_builder: () -> untyped
|
63
|
+
|
64
|
+
def latest_rbs_index: () -> untyped
|
65
|
+
|
66
|
+
def current_subtyping: () -> (untyped | nil)
|
67
|
+
|
68
|
+
def apply_changes: (untyped files, untyped changes) -> untyped
|
69
|
+
|
70
|
+
def update: (untyped changes) -> untyped
|
71
|
+
|
72
|
+
def update_env: (untyped updated_files, paths: untyped) -> untyped
|
73
|
+
|
74
|
+
def rescue_rbs_error: (untyped errors) { () -> untyped } -> untyped
|
75
|
+
|
76
|
+
def update_builder: (ancestor_builder: untyped, paths: untyped) -> untyped
|
77
|
+
|
78
|
+
def type_names: (paths: untyped, env: untyped) -> untyped
|
79
|
+
|
80
|
+
def const_decls: (paths: untyped, env: untyped) -> untyped
|
81
|
+
|
82
|
+
def global_decls: (paths: untyped, ?env: untyped) -> untyped
|
83
|
+
|
84
|
+
def type_name_from_decl: (untyped decl, set: untyped) -> untyped
|
85
|
+
|
86
|
+
def add_descendants: (graph: untyped, names: untyped, set: untyped) -> untyped
|
87
|
+
|
88
|
+
def add_nested_decls: (env: untyped, names: untyped, set: untyped) -> untyped
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class StatsCalculator
|
4
|
+
SuccessStats: untyped
|
5
|
+
|
6
|
+
ErrorStats: untyped
|
7
|
+
|
8
|
+
attr_reader service: untyped
|
9
|
+
|
10
|
+
def initialize: (service: untyped) -> void
|
11
|
+
|
12
|
+
def project: () -> untyped
|
13
|
+
|
14
|
+
def calc_stats: (untyped target, file: untyped) -> untyped
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Steep
|
2
|
+
module Services
|
3
|
+
class TypeCheckService
|
4
|
+
attr_reader project: untyped
|
5
|
+
|
6
|
+
attr_reader signature_validation_diagnostics: untyped
|
7
|
+
|
8
|
+
attr_reader source_files: untyped
|
9
|
+
|
10
|
+
attr_reader signature_services: untyped
|
11
|
+
|
12
|
+
class SourceFile
|
13
|
+
attr_reader path: untyped
|
14
|
+
|
15
|
+
attr_reader target: untyped
|
16
|
+
|
17
|
+
attr_reader content: untyped
|
18
|
+
|
19
|
+
attr_reader node: untyped
|
20
|
+
|
21
|
+
attr_reader typing: untyped
|
22
|
+
|
23
|
+
attr_reader errors: untyped
|
24
|
+
|
25
|
+
def initialize: (path: untyped, node: untyped, content: untyped, typing: untyped, errors: untyped) -> void
|
26
|
+
|
27
|
+
def self.with_syntax_error: (path: untyped, content: untyped, error: untyped) -> untyped
|
28
|
+
|
29
|
+
def self.with_typing: (path: untyped, content: untyped, typing: untyped, node: untyped) -> untyped
|
30
|
+
|
31
|
+
def self.no_data: (path: untyped, content: untyped) -> untyped
|
32
|
+
|
33
|
+
def update_content: (untyped content) -> untyped
|
34
|
+
|
35
|
+
def diagnostics: () -> untyped
|
36
|
+
end
|
37
|
+
|
38
|
+
class TargetRequest
|
39
|
+
attr_reader target: untyped
|
40
|
+
|
41
|
+
attr_reader source_paths: untyped
|
42
|
+
|
43
|
+
def initialize: (target: untyped) -> void
|
44
|
+
|
45
|
+
def signature_updated!: (?bool value) -> self
|
46
|
+
|
47
|
+
def signature_updated?: () -> untyped
|
48
|
+
|
49
|
+
def empty?: () -> untyped
|
50
|
+
|
51
|
+
def ==: (untyped other) -> untyped
|
52
|
+
|
53
|
+
alias eql? ==
|
54
|
+
|
55
|
+
def hash: () -> untyped
|
56
|
+
end
|
57
|
+
|
58
|
+
def initialize: (project: untyped) -> void
|
59
|
+
|
60
|
+
def signature_diagnostics: () -> untyped
|
61
|
+
|
62
|
+
def has_diagnostics?: () -> untyped
|
63
|
+
|
64
|
+
def diagnostics: () -> untyped
|
65
|
+
|
66
|
+
def each_diagnostics: () { (untyped) -> untyped } -> untyped
|
67
|
+
|
68
|
+
def update: (changes: untyped) -> untyped
|
69
|
+
|
70
|
+
def update_and_check: (changes: untyped, assignment: untyped) ?{ () -> untyped } -> untyped
|
71
|
+
|
72
|
+
def validate_signature: (path: untyped) { (untyped) -> untyped } -> untyped
|
73
|
+
|
74
|
+
def typecheck_source: (path: untyped, ?target: untyped) { (untyped) -> untyped } -> (nil | untyped)
|
75
|
+
|
76
|
+
def update_signature: (changes: untyped, requests: untyped) -> untyped
|
77
|
+
|
78
|
+
def update_sources: (changes: untyped, requests: untyped) -> untyped
|
79
|
+
|
80
|
+
def type_check_file: (target: untyped, subtyping: untyped, path: untyped, text: untyped) -> untyped
|
81
|
+
|
82
|
+
def self.type_check: (source: Source, subtyping: Subtyping::Check) -> Typing
|
83
|
+
|
84
|
+
def source_file?: (Pathname path) -> (untyped | nil)
|
85
|
+
|
86
|
+
def signature_file?: (Pathname path) -> untyped
|
87
|
+
|
88
|
+
def app_signature_file?: (Pathname path) -> untyped
|
89
|
+
|
90
|
+
def lib_signature_file?: (Pathname path) -> untyped
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module Steep
|
2
|
+
class Source
|
3
|
+
class LocatedAnnotation
|
4
|
+
attr_reader line: untyped
|
5
|
+
|
6
|
+
attr_reader annotation: untyped
|
7
|
+
|
8
|
+
attr_reader source: untyped
|
9
|
+
|
10
|
+
def initialize: (line: untyped, source: untyped, annotation: untyped) -> void
|
11
|
+
|
12
|
+
def ==: (untyped other) -> untyped
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_reader path: untyped
|
16
|
+
|
17
|
+
attr_reader node: untyped
|
18
|
+
|
19
|
+
attr_reader mapping: untyped
|
20
|
+
|
21
|
+
def initialize: (path: untyped, node: untyped, mapping: untyped) -> void
|
22
|
+
|
23
|
+
class Builder
|
24
|
+
def string_value: (untyped token) -> untyped
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.new_parser: () -> untyped
|
28
|
+
|
29
|
+
def self.parse: (untyped source_code, path: untyped, factory: untyped) -> untyped
|
30
|
+
|
31
|
+
def self.construct_mapping: (node: untyped, annotations: untyped, mapping: untyped, ?line_range: untyped?) -> untyped
|
32
|
+
|
33
|
+
def self.each_child_node: (untyped node) { (untyped) -> untyped } -> untyped
|
34
|
+
|
35
|
+
def self.map_child_nodes: (untyped node) { (untyped) -> untyped } -> untyped
|
36
|
+
|
37
|
+
def annotations: (block: Parser::AST::Node, factory: AST::Types::Factory, context: RBS::Resolver::context) -> AST::Annotation::Collection
|
38
|
+
|
39
|
+
def each_annotation: () { (untyped, untyped) -> untyped } -> untyped
|
40
|
+
|
41
|
+
def each_heredoc_node: (?untyped node, ?untyped parents) { (untyped) -> untyped } -> untyped
|
42
|
+
|
43
|
+
def find_heredoc_nodes: (untyped line, untyped column, untyped position) -> (untyped | nil)
|
44
|
+
|
45
|
+
def find_nodes_loc: (untyped node, untyped position, untyped parents) -> untyped
|
46
|
+
|
47
|
+
def find_nodes: (line: Integer, column: Integer) -> ::Array[Parser::AST::Node]?
|
48
|
+
|
49
|
+
def self.delete_defs: (untyped node, untyped allow_list) -> untyped
|
50
|
+
|
51
|
+
def without_unrelated_defs: (line: untyped, column: untyped) -> (untyped | self)
|
52
|
+
|
53
|
+
def compact_siblings: (untyped node) -> untyped
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Steep
|
2
|
+
module Subtyping
|
3
|
+
class Cache
|
4
|
+
attr_reader subtypes: untyped
|
5
|
+
|
6
|
+
def initialize: () -> void
|
7
|
+
|
8
|
+
def subtype: (untyped relation, untyped self_type, untyped instance_type, untyped class_type, untyped bounds) -> untyped
|
9
|
+
|
10
|
+
def []: (untyped relation, untyped self_type, untyped instance_type, untyped class_type, untyped bounds) -> untyped
|
11
|
+
|
12
|
+
def []=: (untyped relation, untyped self_type, untyped instance_type, untyped class_type, untyped bounds, untyped value) -> untyped
|
13
|
+
|
14
|
+
def no_subtype_cache?: () -> untyped
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|