steep 0.17.0 → 0.21.0
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.yml +5 -1
- data/CHANGELOG.md +24 -0
- data/lib/steep.rb +1 -0
- data/lib/steep/ast/types/factory.rb +15 -12
- data/lib/steep/project/completion_provider.rb +26 -5
- data/lib/steep/project/dsl.rb +7 -1
- data/lib/steep/project/file.rb +7 -0
- data/lib/steep/project/file_loader.rb +1 -1
- data/lib/steep/project/hover_content.rb +9 -3
- data/lib/steep/project/options.rb +7 -0
- data/lib/steep/project/target.rb +31 -22
- data/lib/steep/server/interaction_worker.rb +7 -6
- data/lib/steep/server/signature_worker.rb +1 -0
- data/lib/steep/signature/validator.rb +47 -27
- data/lib/steep/subtyping/check.rb +188 -34
- data/lib/steep/type_construction.rb +163 -62
- data/lib/steep/type_inference/type_env.rb +2 -2
- data/lib/steep/typing.rb +6 -0
- data/lib/steep/version.rb +1 -1
- data/smoke/class/a.rbs +1 -2
- data/smoke/class/f.rb +3 -1
- data/smoke/extension/a.rbs +3 -2
- data/smoke/extension/e.rbs +2 -3
- data/smoke/interface/a.rbs +6 -6
- data/steep.gemspec +1 -1
- metadata +4 -4
@@ -31,8 +31,8 @@ module Steep
|
|
31
31
|
annotations.const_types.each do |name, type|
|
32
32
|
env.set(const: name, type: type)
|
33
33
|
end
|
34
|
-
signatures.
|
35
|
-
type =
|
34
|
+
signatures.global_decls.each do |name, entry|
|
35
|
+
type = entry.decl.type
|
36
36
|
env.set(gvar: name, type: subtyping.factory.type(type))
|
37
37
|
end
|
38
38
|
end
|
data/lib/steep/typing.rb
CHANGED
@@ -95,6 +95,12 @@ module Steep
|
|
95
95
|
end_pos = node.loc.end.begin_pos
|
96
96
|
add_context(begin_pos..end_pos, context: context)
|
97
97
|
|
98
|
+
when :sclass
|
99
|
+
name_node = node.children[0]
|
100
|
+
begin_pos = name_node.loc.expression.end_pos
|
101
|
+
end_pos = node.loc.end.begin_pos
|
102
|
+
add_context(begin_pos..end_pos, context: context)
|
103
|
+
|
98
104
|
when :def, :defs
|
99
105
|
args_node = case node.type
|
100
106
|
when :def
|
data/lib/steep/version.rb
CHANGED
data/smoke/class/a.rbs
CHANGED
data/smoke/class/f.rb
CHANGED
data/smoke/extension/a.rbs
CHANGED
data/smoke/extension/e.rbs
CHANGED
data/smoke/interface/a.rbs
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
class A
|
2
2
|
def foo: -> _Foo
|
3
3
|
def hello: -> void
|
4
|
-
end
|
5
4
|
|
6
|
-
class
|
7
|
-
|
8
|
-
end
|
5
|
+
class Object
|
6
|
+
def object?: -> bool
|
7
|
+
end
|
9
8
|
|
10
|
-
interface
|
11
|
-
|
9
|
+
interface _Foo
|
10
|
+
def foo: -> Object
|
11
|
+
end
|
12
12
|
end
|
data/steep.gemspec
CHANGED
@@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
|
|
41
41
|
spec.add_runtime_dependency "rainbow", ">= 2.2.2", "< 4.0"
|
42
42
|
spec.add_runtime_dependency "listen", "~> 3.1"
|
43
43
|
spec.add_runtime_dependency "language_server-protocol", "~> 3.14.0.2"
|
44
|
-
spec.add_runtime_dependency "rbs", "~> 0.
|
44
|
+
spec.add_runtime_dependency "rbs", "~> 0.7.0"
|
45
45
|
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: 0.
|
4
|
+
version: 0.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -190,14 +190,14 @@ dependencies:
|
|
190
190
|
requirements:
|
191
191
|
- - "~>"
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: 0.
|
193
|
+
version: 0.7.0
|
194
194
|
type: :runtime
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: 0.
|
200
|
+
version: 0.7.0
|
201
201
|
description: Gradual Typing for Ruby
|
202
202
|
email:
|
203
203
|
- matsumoto@soutaro.com
|