steep 0.13.0 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +0 -3
- data/CHANGELOG.md +28 -0
- data/Rakefile +0 -13
- data/bin/setup +0 -2
- data/bin/smoke_runner.rb +0 -1
- data/exe/steep +0 -1
- data/lib/steep.rb +33 -1
- data/lib/steep/annotation_parser.rb +4 -4
- data/lib/steep/ast/buffer.rb +11 -7
- data/lib/steep/ast/builtin.rb +8 -0
- data/lib/steep/ast/types/factory.rb +124 -89
- data/lib/steep/cli.rb +16 -1
- data/lib/steep/drivers/annotations.rb +1 -1
- data/lib/steep/drivers/check.rb +20 -4
- data/lib/steep/drivers/init.rb +5 -5
- data/lib/steep/drivers/langserver.rb +13 -287
- data/lib/steep/drivers/utils/driver_helper.rb +1 -1
- data/lib/steep/drivers/vendor.rb +2 -2
- data/lib/steep/drivers/watch.rb +97 -85
- data/lib/steep/drivers/worker.rb +51 -0
- data/lib/steep/project.rb +9 -5
- data/lib/steep/project/completion_provider.rb +298 -0
- data/lib/steep/project/dsl.rb +14 -0
- data/lib/steep/project/file.rb +54 -47
- data/lib/steep/project/hover_content.rb +17 -8
- data/lib/steep/project/options.rb +25 -3
- data/lib/steep/project/target.rb +40 -24
- data/lib/steep/server/base_worker.rb +56 -0
- data/lib/steep/server/code_worker.rb +151 -0
- data/lib/steep/server/interaction_worker.rb +281 -0
- data/lib/steep/server/master.rb +196 -0
- data/lib/steep/server/signature_worker.rb +148 -0
- data/lib/steep/server/utils.rb +36 -0
- data/lib/steep/server/worker_process.rb +62 -0
- data/lib/steep/signature/errors.rb +1 -1
- data/lib/steep/signature/validator.rb +13 -13
- data/lib/steep/source.rb +1 -1
- data/lib/steep/type_construction.rb +1004 -727
- data/lib/steep/type_inference/constant_env.rb +3 -11
- data/lib/steep/type_inference/context.rb +8 -3
- data/lib/steep/type_inference/context_array.rb +111 -0
- data/lib/steep/type_inference/local_variable_type_env.rb +226 -0
- data/lib/steep/type_inference/logic.rb +130 -0
- data/lib/steep/type_inference/type_env.rb +5 -69
- data/lib/steep/typing.rb +91 -23
- data/lib/steep/version.rb +1 -1
- data/smoke/alias/Steepfile +1 -0
- data/smoke/alias/a.rb +1 -1
- data/smoke/and/Steepfile +1 -0
- data/smoke/array/Steepfile +1 -0
- data/smoke/array/b.rb +0 -2
- data/smoke/block/Steepfile +1 -0
- data/smoke/case/Steepfile +1 -0
- data/smoke/class/Steepfile +1 -0
- data/smoke/const/Steepfile +1 -0
- data/smoke/dstr/Steepfile +1 -0
- data/smoke/ensure/Steepfile +1 -0
- data/smoke/enumerator/Steepfile +1 -0
- data/smoke/extension/Steepfile +1 -0
- data/smoke/extension/c.rb +1 -0
- data/smoke/hash/Steepfile +1 -0
- data/smoke/hello/Steepfile +1 -0
- data/smoke/if/Steepfile +1 -0
- data/smoke/if/a.rb +1 -1
- data/smoke/implements/Steepfile +1 -0
- data/smoke/initialize/Steepfile +1 -0
- data/smoke/integer/Steepfile +1 -0
- data/smoke/interface/Steepfile +1 -0
- data/smoke/kwbegin/Steepfile +1 -0
- data/smoke/lambda/Steepfile +1 -0
- data/smoke/literal/Steepfile +1 -0
- data/smoke/map/Steepfile +1 -0
- data/smoke/method/Steepfile +1 -0
- data/smoke/module/Steepfile +1 -0
- data/smoke/regexp/Steepfile +1 -0
- data/smoke/regexp/b.rb +4 -4
- data/smoke/regression/Steepfile +1 -0
- data/smoke/rescue/Steepfile +1 -0
- data/smoke/rescue/a.rb +1 -1
- data/smoke/self/Steepfile +1 -0
- data/smoke/skip/Steepfile +1 -0
- data/smoke/stdout/Steepfile +1 -0
- data/smoke/super/Steepfile +1 -0
- data/smoke/type_case/Steepfile +1 -0
- data/smoke/yield/Steepfile +1 -0
- data/steep.gemspec +8 -8
- metadata +38 -138
- data/exe/rbs +0 -3
- data/exe/ruby-signature +0 -3
- data/vendor/ruby-signature/.github/workflows/ruby.yml +0 -27
- data/vendor/ruby-signature/.gitignore +0 -12
- data/vendor/ruby-signature/.rubocop.yml +0 -15
- data/vendor/ruby-signature/BSDL +0 -22
- data/vendor/ruby-signature/COPYING +0 -56
- data/vendor/ruby-signature/Gemfile +0 -6
- data/vendor/ruby-signature/README.md +0 -93
- data/vendor/ruby-signature/Rakefile +0 -66
- data/vendor/ruby-signature/bin/annotate-with-rdoc +0 -156
- data/vendor/ruby-signature/bin/console +0 -14
- data/vendor/ruby-signature/bin/query-rdoc +0 -103
- data/vendor/ruby-signature/bin/setup +0 -10
- data/vendor/ruby-signature/bin/sort +0 -88
- data/vendor/ruby-signature/bin/test_runner.rb +0 -17
- data/vendor/ruby-signature/docs/CONTRIBUTING.md +0 -97
- data/vendor/ruby-signature/docs/sigs.md +0 -148
- data/vendor/ruby-signature/docs/stdlib.md +0 -152
- data/vendor/ruby-signature/docs/syntax.md +0 -528
- data/vendor/ruby-signature/exe/rbs +0 -3
- data/vendor/ruby-signature/exe/ruby-signature +0 -7
- data/vendor/ruby-signature/lib/ruby/signature.rb +0 -64
- data/vendor/ruby-signature/lib/ruby/signature/ast/annotation.rb +0 -29
- data/vendor/ruby-signature/lib/ruby/signature/ast/comment.rb +0 -29
- data/vendor/ruby-signature/lib/ruby/signature/ast/declarations.rb +0 -391
- data/vendor/ruby-signature/lib/ruby/signature/ast/members.rb +0 -364
- data/vendor/ruby-signature/lib/ruby/signature/buffer.rb +0 -52
- data/vendor/ruby-signature/lib/ruby/signature/builtin_names.rb +0 -54
- data/vendor/ruby-signature/lib/ruby/signature/cli.rb +0 -534
- data/vendor/ruby-signature/lib/ruby/signature/constant.rb +0 -28
- data/vendor/ruby-signature/lib/ruby/signature/constant_table.rb +0 -152
- data/vendor/ruby-signature/lib/ruby/signature/definition.rb +0 -172
- data/vendor/ruby-signature/lib/ruby/signature/definition_builder.rb +0 -921
- data/vendor/ruby-signature/lib/ruby/signature/environment.rb +0 -283
- data/vendor/ruby-signature/lib/ruby/signature/environment_loader.rb +0 -138
- data/vendor/ruby-signature/lib/ruby/signature/environment_walker.rb +0 -126
- data/vendor/ruby-signature/lib/ruby/signature/errors.rb +0 -189
- data/vendor/ruby-signature/lib/ruby/signature/location.rb +0 -104
- data/vendor/ruby-signature/lib/ruby/signature/method_type.rb +0 -125
- data/vendor/ruby-signature/lib/ruby/signature/namespace.rb +0 -93
- data/vendor/ruby-signature/lib/ruby/signature/parser.y +0 -1343
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rb.rb +0 -441
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rbi.rb +0 -579
- data/vendor/ruby-signature/lib/ruby/signature/prototype/runtime.rb +0 -383
- data/vendor/ruby-signature/lib/ruby/signature/substitution.rb +0 -48
- data/vendor/ruby-signature/lib/ruby/signature/test.rb +0 -28
- data/vendor/ruby-signature/lib/ruby/signature/test/errors.rb +0 -63
- data/vendor/ruby-signature/lib/ruby/signature/test/hook.rb +0 -290
- data/vendor/ruby-signature/lib/ruby/signature/test/setup.rb +0 -58
- data/vendor/ruby-signature/lib/ruby/signature/test/spy.rb +0 -324
- data/vendor/ruby-signature/lib/ruby/signature/test/test_helper.rb +0 -185
- data/vendor/ruby-signature/lib/ruby/signature/test/type_check.rb +0 -256
- data/vendor/ruby-signature/lib/ruby/signature/type_name.rb +0 -72
- data/vendor/ruby-signature/lib/ruby/signature/types.rb +0 -932
- data/vendor/ruby-signature/lib/ruby/signature/variance_calculator.rb +0 -140
- data/vendor/ruby-signature/lib/ruby/signature/vendorer.rb +0 -49
- data/vendor/ruby-signature/lib/ruby/signature/version.rb +0 -5
- data/vendor/ruby-signature/lib/ruby/signature/writer.rb +0 -271
- data/vendor/ruby-signature/ruby-signature.gemspec +0 -45
- data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +0 -3
- data/vendor/ruby-signature/stdlib/base64/base64.rbs +0 -15
- data/vendor/ruby-signature/stdlib/builtin/array.rbs +0 -1997
- data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +0 -280
- data/vendor/ruby-signature/stdlib/builtin/binding.rbs +0 -177
- data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +0 -35
- data/vendor/ruby-signature/stdlib/builtin/class.rbs +0 -145
- data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +0 -116
- data/vendor/ruby-signature/stdlib/builtin/complex.rbs +0 -400
- data/vendor/ruby-signature/stdlib/builtin/constants.rbs +0 -37
- data/vendor/ruby-signature/stdlib/builtin/data.rbs +0 -5
- data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +0 -2
- data/vendor/ruby-signature/stdlib/builtin/dir.rbs +0 -419
- data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +0 -606
- data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +0 -404
- data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +0 -260
- data/vendor/ruby-signature/stdlib/builtin/errno.rbs +0 -781
- data/vendor/ruby-signature/stdlib/builtin/errors.rbs +0 -582
- data/vendor/ruby-signature/stdlib/builtin/exception.rbs +0 -193
- data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +0 -40
- data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +0 -68
- data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +0 -12
- data/vendor/ruby-signature/stdlib/builtin/file.rbs +0 -476
- data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +0 -59
- data/vendor/ruby-signature/stdlib/builtin/float.rbs +0 -696
- data/vendor/ruby-signature/stdlib/builtin/gc.rbs +0 -121
- data/vendor/ruby-signature/stdlib/builtin/hash.rbs +0 -1029
- data/vendor/ruby-signature/stdlib/builtin/integer.rbs +0 -710
- data/vendor/ruby-signature/stdlib/builtin/io.rbs +0 -683
- data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +0 -574
- data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +0 -135
- data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +0 -141
- data/vendor/ruby-signature/stdlib/builtin/math.rbs +0 -66
- data/vendor/ruby-signature/stdlib/builtin/method.rbs +0 -182
- data/vendor/ruby-signature/stdlib/builtin/module.rbs +0 -248
- data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +0 -82
- data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +0 -409
- data/vendor/ruby-signature/stdlib/builtin/object.rbs +0 -824
- data/vendor/ruby-signature/stdlib/builtin/proc.rbs +0 -426
- data/vendor/ruby-signature/stdlib/builtin/process.rbs +0 -354
- data/vendor/ruby-signature/stdlib/builtin/random.rbs +0 -93
- data/vendor/ruby-signature/stdlib/builtin/range.rbs +0 -226
- data/vendor/ruby-signature/stdlib/builtin/rational.rbs +0 -424
- data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +0 -10
- data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +0 -131
- data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +0 -14
- data/vendor/ruby-signature/stdlib/builtin/signal.rbs +0 -55
- data/vendor/ruby-signature/stdlib/builtin/string.rbs +0 -770
- data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +0 -13
- data/vendor/ruby-signature/stdlib/builtin/struct.rbs +0 -40
- data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +0 -230
- data/vendor/ruby-signature/stdlib/builtin/thread.rbs +0 -1112
- data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +0 -23
- data/vendor/ruby-signature/stdlib/builtin/time.rbs +0 -739
- data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +0 -91
- data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +0 -46
- data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +0 -159
- data/vendor/ruby-signature/stdlib/builtin/warning.rbs +0 -17
- data/vendor/ruby-signature/stdlib/erb/erb.rbs +0 -18
- data/vendor/ruby-signature/stdlib/find/find.rbs +0 -44
- data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +0 -21
- data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +0 -23
- data/vendor/ruby-signature/stdlib/prime/prime.rbs +0 -188
- data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +0 -9
- data/vendor/ruby-signature/stdlib/set/set.rbs +0 -77
- data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +0 -53
@@ -1,9 +0,0 @@
|
|
1
|
-
module SecureRandom
|
2
|
-
def self.alphanumeric: (?Integer?) -> String
|
3
|
-
def self.base64: (?Integer?) -> String
|
4
|
-
def self.hex: (?Integer?) -> String
|
5
|
-
def self.random_bytes: (?Integer?) -> String
|
6
|
-
def self.random_number: (?Integer?) -> (Integer | Float)
|
7
|
-
def self.urlsafe_base64: (?Integer?, ?bool?) -> String
|
8
|
-
def self.uuid: () -> String
|
9
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
class Set[A]
|
2
|
-
def self.`[]`: [X] (*X) -> Set[X]
|
3
|
-
|
4
|
-
def initialize: (_Each[A, untyped]) -> untyped
|
5
|
-
| [X] (_Each[X, untyped]) { (X) -> A } -> untyped
|
6
|
-
| (?nil) -> untyped
|
7
|
-
|
8
|
-
def intersection: (_Each[A, untyped]) -> self
|
9
|
-
def &: (_Each[A, untyped]) -> self
|
10
|
-
|
11
|
-
def union: (_Each[A, untyped]) -> self
|
12
|
-
def `+`: (_Each[A, untyped]) -> self
|
13
|
-
def `|`: (_Each[A, untyped]) -> self
|
14
|
-
|
15
|
-
def difference: (_Each[A, untyped]) -> self
|
16
|
-
def `-`: (_Each[A, untyped]) -> self
|
17
|
-
|
18
|
-
def add: (A) -> self
|
19
|
-
def `<<`: (A) -> self
|
20
|
-
def add?: (A) -> self?
|
21
|
-
|
22
|
-
def member?: (untyped) -> bool
|
23
|
-
def include?: (untyped) -> bool
|
24
|
-
|
25
|
-
def `^`: (_Each[A, untyped]) -> self
|
26
|
-
|
27
|
-
def classify: [X] { (A) -> X } -> Hash[X, self]
|
28
|
-
|
29
|
-
def clear: -> self
|
30
|
-
|
31
|
-
def collect!: { (A) -> A } -> self
|
32
|
-
alias map! collect!
|
33
|
-
|
34
|
-
def delete: (untyped) -> self
|
35
|
-
def delete?: (untyped) -> self?
|
36
|
-
|
37
|
-
def delete_if: { (A) -> untyped } -> self
|
38
|
-
def reject!: { (A) -> untyped } -> self
|
39
|
-
|
40
|
-
def disjoint?: (self) -> bool
|
41
|
-
|
42
|
-
def divide: { (A, A) -> untyped } -> Set[self]
|
43
|
-
| { (A) -> untyped } -> Set[self]
|
44
|
-
|
45
|
-
def each: { (A) -> void } -> self
|
46
|
-
|
47
|
-
def empty?: -> bool
|
48
|
-
|
49
|
-
def flatten: -> Set[untyped]
|
50
|
-
|
51
|
-
def intersect?: -> bool
|
52
|
-
|
53
|
-
def keep_if: { (A) -> untyped } -> self
|
54
|
-
|
55
|
-
def size: -> Integer
|
56
|
-
alias length size
|
57
|
-
|
58
|
-
def merge: (_Each[A, untyped]) -> self
|
59
|
-
|
60
|
-
def subset?: (self) -> bool
|
61
|
-
def proper_subst?: (self) -> bool
|
62
|
-
|
63
|
-
def superset?: (self) -> bool
|
64
|
-
def proper_superset?: (self) -> bool
|
65
|
-
|
66
|
-
def replace: (_Each[A, untyped]) -> self
|
67
|
-
|
68
|
-
def reset: -> self
|
69
|
-
|
70
|
-
def select!: { (A) -> untyped } -> self?
|
71
|
-
|
72
|
-
def subtract: (_Each[A, untyped]) -> self
|
73
|
-
|
74
|
-
def to_a: -> Array[A]
|
75
|
-
|
76
|
-
include Enumerable[A, self]
|
77
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
extension Dir (tmpdir)
|
2
|
-
# Returns the operating system's temporary file path.
|
3
|
-
#
|
4
|
-
def self.tmpdir: () -> String
|
5
|
-
|
6
|
-
# Dir.mktmpdir creates a temporary directory.
|
7
|
-
#
|
8
|
-
# The directory is created with 0700 permission. Application should not change
|
9
|
-
# the permission to make the temporary directory accessible from other users.
|
10
|
-
#
|
11
|
-
# The prefix and suffix of the name of the directory is specified by the
|
12
|
-
# optional first argument, *prefix_suffix*.
|
13
|
-
# * If it is not specified or nil, "d" is used as the prefix and no suffix is
|
14
|
-
# used.
|
15
|
-
# * If it is a string, it is used as the prefix and no suffix is used.
|
16
|
-
# * If it is an array, first element is used as the prefix and second element
|
17
|
-
# is used as a suffix.
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# Dir.mktmpdir {|dir| dir is ".../d..." }
|
21
|
-
# Dir.mktmpdir("foo") {|dir| dir is ".../foo..." }
|
22
|
-
# Dir.mktmpdir(["foo", "bar"]) {|dir| dir is ".../foo...bar" }
|
23
|
-
#
|
24
|
-
# The directory is created under Dir.tmpdir or the optional second argument
|
25
|
-
# *tmpdir* if non-nil value is given.
|
26
|
-
#
|
27
|
-
# Dir.mktmpdir {|dir| dir is "#{Dir.tmpdir}/d..." }
|
28
|
-
# Dir.mktmpdir(nil, "/var/tmp") {|dir| dir is "/var/tmp/d..." }
|
29
|
-
#
|
30
|
-
# If a block is given, it is yielded with the path of the directory. The
|
31
|
-
# directory and its contents are removed using FileUtils.remove_entry before
|
32
|
-
# Dir.mktmpdir returns. The value of the block is returned.
|
33
|
-
#
|
34
|
-
# Dir.mktmpdir {|dir|
|
35
|
-
# # use the directory...
|
36
|
-
# open("#{dir}/foo", "w") { ... }
|
37
|
-
# }
|
38
|
-
#
|
39
|
-
# If a block is not given, The path of the directory is returned. In this case,
|
40
|
-
# Dir.mktmpdir doesn't remove the directory.
|
41
|
-
#
|
42
|
-
# dir = Dir.mktmpdir
|
43
|
-
# begin
|
44
|
-
# # use the directory...
|
45
|
-
# open("#{dir}/foo", "w") { ... }
|
46
|
-
# ensure
|
47
|
-
# # remove the directory.
|
48
|
-
# FileUtils.remove_entry dir
|
49
|
-
# end
|
50
|
-
#
|
51
|
-
def self.mktmpdir: (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) -> String
|
52
|
-
| [X] (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) { (String) -> X } -> X
|
53
|
-
end
|