steep 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +1 -1
- data/CHANGELOG.md +5 -0
- data/lib/steep/cli.rb +16 -1
- data/lib/steep/drivers/annotations.rb +1 -1
- data/lib/steep/drivers/langserver.rb +13 -462
- data/lib/steep/drivers/utils/driver_helper.rb +1 -1
- data/lib/steep/drivers/watch.rb +97 -85
- data/lib/steep/drivers/worker.rb +51 -0
- data/lib/steep/project/completion_provider.rb +4 -2
- data/lib/steep/project/file.rb +1 -0
- data/lib/steep/project/hover_content.rb +5 -2
- data/lib/steep/project/target.rb +30 -20
- data/lib/steep/project.rb +9 -5
- 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/validator.rb +5 -5
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +11 -0
- data/steep.gemspec +1 -1
- data/vendor/ruby-signature/README.md +18 -18
- data/vendor/ruby-signature/Rakefile +90 -15
- data/vendor/ruby-signature/rbs.gemspec +1 -0
- data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +1 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +1 -1
- data/vendor/ruby-signature/stdlib/builtin/module.rbs +2 -2
- data/vendor/ruby-signature/stdlib/json/json.rbs +335 -0
- metadata +14 -5
@@ -0,0 +1,335 @@
|
|
1
|
+
interface _ToJson
|
2
|
+
def to_json: (?JSON::State state) -> String
|
3
|
+
end
|
4
|
+
|
5
|
+
interface _JsonToWritableIO
|
6
|
+
def to_io: () -> _JsonWrite
|
7
|
+
end
|
8
|
+
|
9
|
+
interface _JsonWrite
|
10
|
+
def write: (String json) -> void
|
11
|
+
end
|
12
|
+
|
13
|
+
interface _JsonReadableIO
|
14
|
+
def to_io: () -> _JsonRead
|
15
|
+
end
|
16
|
+
|
17
|
+
interface _JsonRead
|
18
|
+
def read: () -> string
|
19
|
+
end
|
20
|
+
|
21
|
+
type json_options = Hash[Symbol, untyped]
|
22
|
+
|
23
|
+
class JSON::State
|
24
|
+
end
|
25
|
+
|
26
|
+
# This module holds all the modules/classes that implement JSON's functionality
|
27
|
+
# as C extensions.
|
28
|
+
#
|
29
|
+
module JSON::Ext
|
30
|
+
end
|
31
|
+
|
32
|
+
# This is the JSON generator implemented as a C extension. It can be configured
|
33
|
+
# to be used by setting
|
34
|
+
#
|
35
|
+
# JSON.generator = JSON::Ext::Generator
|
36
|
+
#
|
37
|
+
# with the method generator= in JSON.
|
38
|
+
#
|
39
|
+
module JSON::Ext::Generator
|
40
|
+
end
|
41
|
+
|
42
|
+
class JSON::Ext::Generator::State
|
43
|
+
end
|
44
|
+
|
45
|
+
module JSON::Pure
|
46
|
+
end
|
47
|
+
|
48
|
+
module JSON::Pure::Generator
|
49
|
+
end
|
50
|
+
|
51
|
+
class JSON::Pure::Generator::State
|
52
|
+
end
|
53
|
+
|
54
|
+
type json_generator = singleton(::JSON::Ext::Generator) | singleton(::JSON::Pure::Generator)
|
55
|
+
type json_parser = singleton(::JSON::Ext::Parser) | singleton(::JSON::Pure::Parser)
|
56
|
+
type json_state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure::Generator::State)
|
57
|
+
|
58
|
+
# # JavaScript Object Notation (JSON)
|
59
|
+
#
|
60
|
+
# JSON is a lightweight data-interchange format. It is easy for us humans to
|
61
|
+
# read and write. Plus, equally simple for machines to generate or parse. JSON
|
62
|
+
# is completely language agnostic, making it the ideal interchange format.
|
63
|
+
#
|
64
|
+
# Built on two universally available structures:
|
65
|
+
# 1. A collection of name/value pairs. Often referred to as an _object_, hash table, record, struct, keyed list, or associative array.
|
66
|
+
# 2. An ordered list of values. More commonly called an _array_, vector, sequence or list.
|
67
|
+
#
|
68
|
+
# To read more about JSON visit: http://json.org
|
69
|
+
#
|
70
|
+
# ## Parsing JSON
|
71
|
+
#
|
72
|
+
# To parse a JSON string received by another application or generated within
|
73
|
+
# your existing application:
|
74
|
+
#
|
75
|
+
# require 'json'
|
76
|
+
#
|
77
|
+
# my_hash = JSON.parse('{"hello": "goodbye"}')
|
78
|
+
# puts my_hash["hello"] => "goodbye"
|
79
|
+
#
|
80
|
+
# Notice the extra quotes `''` around the hash notation. Ruby expects the
|
81
|
+
# argument to be a string and can't convert objects like a hash or array.
|
82
|
+
#
|
83
|
+
# Ruby converts your string into a hash
|
84
|
+
#
|
85
|
+
# ## Generating JSON
|
86
|
+
#
|
87
|
+
# Creating a JSON string for communication or serialization is just as simple.
|
88
|
+
#
|
89
|
+
# require 'json'
|
90
|
+
#
|
91
|
+
# my_hash = {:hello => "goodbye"}
|
92
|
+
# puts JSON.generate(my_hash) => "{\"hello\":\"goodbye\"}"
|
93
|
+
#
|
94
|
+
# Or an alternative way:
|
95
|
+
#
|
96
|
+
# require 'json'
|
97
|
+
# puts {:hello => "goodbye"}.to_json => "{\"hello\":\"goodbye\"}"
|
98
|
+
#
|
99
|
+
# `JSON.generate` only allows objects or arrays to be converted to JSON syntax.
|
100
|
+
# `to_json`, however, accepts many Ruby classes even though it acts only as a
|
101
|
+
# method for serialization:
|
102
|
+
#
|
103
|
+
# require 'json'
|
104
|
+
#
|
105
|
+
# 1.to_json => "1"
|
106
|
+
#
|
107
|
+
module JSON
|
108
|
+
# If *object* is string-like, parse the string and return the parsed result as a
|
109
|
+
# Ruby data structure. Otherwise generate a JSON text from the Ruby data
|
110
|
+
# structure object and return it.
|
111
|
+
#
|
112
|
+
# The *opts* argument is passed through to generate/parse respectively. See
|
113
|
+
# generate and parse for their documentation.
|
114
|
+
#
|
115
|
+
def self.[]: (untyped object, ?json_options opts) -> untyped
|
116
|
+
|
117
|
+
# This is create identifier, which is used to decide if the *json_create* hook
|
118
|
+
# of a class should be called. It defaults to 'json_class'.
|
119
|
+
#
|
120
|
+
def self.create_id: () -> _ToS
|
121
|
+
|
122
|
+
def self.create_id=: (_ToS create_id) -> _ToS
|
123
|
+
|
124
|
+
def self.deep_const_get: (_ToS path) -> untyped
|
125
|
+
# Dumps *obj* as a JSON string, i.e. calls generate on the object and returns
|
126
|
+
# the result.
|
127
|
+
#
|
128
|
+
# If anIO (an IO-like object or an object that responds to the write method) was
|
129
|
+
# given, the resulting JSON is written to it.
|
130
|
+
#
|
131
|
+
# If the number of nested arrays or objects exceeds *limit*, an ArgumentError
|
132
|
+
# exception is raised. This argument is similar (but not exactly the same!) to
|
133
|
+
# the *limit* argument in Marshal.dump.
|
134
|
+
#
|
135
|
+
# The default options for the generator can be changed via the
|
136
|
+
# dump_default_options method.
|
137
|
+
#
|
138
|
+
# This method is part of the implementation of the load/dump interface of
|
139
|
+
# Marshal and YAML.
|
140
|
+
#
|
141
|
+
def self?.dump: (_ToJson obj, ?Integer limit) -> String
|
142
|
+
| (_ToJson obj, _JsonToWritableIO anIO) -> _JsonWrite
|
143
|
+
| (_ToJson obj, _JsonWrite anIO, ?Integer limit) -> _JsonWrite
|
144
|
+
|
145
|
+
# The global default options for the JSON.dump method:
|
146
|
+
# :max_nesting: false
|
147
|
+
# :allow_nan: true
|
148
|
+
# :allow_blank: true
|
149
|
+
#
|
150
|
+
def self.dump_default_options: () -> json_options
|
151
|
+
|
152
|
+
def self.dump_default_options=: (json_options) -> json_options
|
153
|
+
|
154
|
+
# Generate a JSON document from the Ruby data structure *obj* and return it.
|
155
|
+
# This method disables the checks for circles in Ruby objects.
|
156
|
+
#
|
157
|
+
# **WARNING**: Be careful not to pass any Ruby data structures with circles as
|
158
|
+
# *obj* argument because this will cause JSON to go into an infinite loop.
|
159
|
+
#
|
160
|
+
def self?.fast_generate: (_ToJson obj, ?json_options opts) -> String
|
161
|
+
|
162
|
+
alias self.fast_unparse self.fast_generate
|
163
|
+
alias fast_unparse fast_generate
|
164
|
+
|
165
|
+
# Generate a JSON document from the Ruby data structure *obj* and return it.
|
166
|
+
# *state* is * a JSON::State object,
|
167
|
+
# * or a Hash like object (responding to to_hash),
|
168
|
+
# * an object convertible into a hash by a to_h method,
|
169
|
+
#
|
170
|
+
# that is used as or to configure a State object.
|
171
|
+
#
|
172
|
+
# It defaults to a state object, that creates the shortest possible JSON text in
|
173
|
+
# one line, checks for circular data structures and doesn't allow NaN, Infinity,
|
174
|
+
# and -Infinity.
|
175
|
+
#
|
176
|
+
# A *state* hash can have the following keys:
|
177
|
+
# * **indent**: a string used to indent levels (default: ''),
|
178
|
+
# * **space**: a string that is put after, a : or , delimiter (default: ''),
|
179
|
+
# * **space_before**: a string that is put before a : pair delimiter (default:
|
180
|
+
# ''),
|
181
|
+
# * **object_nl**: a string that is put at the end of a JSON object (default:
|
182
|
+
# ''),
|
183
|
+
# * **array_nl**: a string that is put at the end of a JSON array (default:
|
184
|
+
# ''),
|
185
|
+
# * **allow_nan**: true if NaN, Infinity, and -Infinity should be generated,
|
186
|
+
# otherwise an exception is thrown if these values are encountered. This
|
187
|
+
# options defaults to false.
|
188
|
+
# * **max_nesting**: The maximum depth of nesting allowed in the data
|
189
|
+
# structures from which JSON is to be generated. Disable depth checking with
|
190
|
+
# :max_nesting => false, it defaults to 100.
|
191
|
+
#
|
192
|
+
#
|
193
|
+
# See also the fast_generate for the fastest creation method with the least
|
194
|
+
# amount of sanity checks, and the pretty_generate method for some defaults for
|
195
|
+
# pretty output.
|
196
|
+
#
|
197
|
+
def self?.generate: (_ToJson obj, ?json_options opts) -> String
|
198
|
+
|
199
|
+
# Returns the JSON generator module that is used by JSON. This is either
|
200
|
+
# JSON::Ext::Generator or JSON::Pure::Generator.
|
201
|
+
#
|
202
|
+
def self.generator: () -> json_generator
|
203
|
+
|
204
|
+
def self.generator=: (json_generator generator) -> void
|
205
|
+
|
206
|
+
# Encodes string using Ruby's *String.encode*
|
207
|
+
#
|
208
|
+
def self.iconv: (encoding to, encoding from, String string) -> String
|
209
|
+
|
210
|
+
# Load a ruby data structure from a JSON *source* and return it. A source can
|
211
|
+
# either be a string-like object, an IO-like object, or an object responding to
|
212
|
+
# the read method. If *proc* was given, it will be called with any nested Ruby
|
213
|
+
# object as an argument recursively in depth first order. To modify the default
|
214
|
+
# options pass in the optional *options* argument as well.
|
215
|
+
#
|
216
|
+
# BEWARE: This method is meant to serialise data from trusted user input, like
|
217
|
+
# from your own database server or clients under your control, it could be
|
218
|
+
# dangerous to allow untrusted users to pass JSON sources into it. The default
|
219
|
+
# options for the parser can be changed via the load_default_options method.
|
220
|
+
#
|
221
|
+
# This method is part of the implementation of the load/dump interface of
|
222
|
+
# Marshal and YAML.
|
223
|
+
#
|
224
|
+
def self?.load: (string | _JsonReadableIO | _JsonRead source, ?Proc proc, ?json_options options) -> untyped
|
225
|
+
|
226
|
+
# The global default options for the JSON.load method:
|
227
|
+
# :max_nesting: false
|
228
|
+
# :allow_nan: true
|
229
|
+
# :allow_blank: true
|
230
|
+
#
|
231
|
+
def self.load_default_options: () -> json_options
|
232
|
+
|
233
|
+
def self.load_default_options=: (json_options) -> json_options
|
234
|
+
|
235
|
+
# Parse the JSON document *source* into a Ruby data structure and return it.
|
236
|
+
#
|
237
|
+
# *opts* can have the following keys:
|
238
|
+
# * **max_nesting**: The maximum depth of nesting allowed in the parsed data
|
239
|
+
# structures. Disable depth checking with :max_nesting => false. It defaults
|
240
|
+
# to 100.
|
241
|
+
# * **allow_nan**: If set to true, allow NaN, Infinity and -Infinity in
|
242
|
+
# defiance of RFC 7159 to be parsed by the Parser. This option defaults to
|
243
|
+
# false.
|
244
|
+
# * **symbolize_names**: If set to true, returns symbols for the names (keys)
|
245
|
+
# in a JSON object. Otherwise strings are returned. Strings are the default.
|
246
|
+
# * **create_additions**: If set to false, the Parser doesn't create additions
|
247
|
+
# even if a matching class and create_id was found. This option defaults to
|
248
|
+
# false.
|
249
|
+
# * **object_class**: Defaults to Hash
|
250
|
+
# * **array_class**: Defaults to Array
|
251
|
+
#
|
252
|
+
#
|
253
|
+
def self?.parse: (string source, ?json_options opts) -> untyped
|
254
|
+
|
255
|
+
# Parse the JSON document *source* into a Ruby data structure and return it. The
|
256
|
+
# bang version of the parse method defaults to the more dangerous values for the
|
257
|
+
# *opts* hash, so be sure only to parse trusted *source* documents.
|
258
|
+
#
|
259
|
+
# *opts* can have the following keys:
|
260
|
+
# * **max_nesting**: The maximum depth of nesting allowed in the parsed data
|
261
|
+
# structures. Enable depth checking with :max_nesting => anInteger. The
|
262
|
+
# parse! methods defaults to not doing max depth checking: This can be
|
263
|
+
# dangerous if someone wants to fill up your stack.
|
264
|
+
# * **allow_nan**: If set to true, allow NaN, Infinity, and -Infinity in
|
265
|
+
# defiance of RFC 7159 to be parsed by the Parser. This option defaults to
|
266
|
+
# true.
|
267
|
+
# * **create_additions**: If set to false, the Parser doesn't create additions
|
268
|
+
# even if a matching class and create_id was found. This option defaults to
|
269
|
+
# false.
|
270
|
+
#
|
271
|
+
#
|
272
|
+
def self?.parse!: (string source, ?json_options opts) -> untyped
|
273
|
+
|
274
|
+
# Returns the JSON parser class that is used by JSON. This is either
|
275
|
+
# JSON::Ext::Parser or JSON::Pure::Parser.
|
276
|
+
#
|
277
|
+
def self.parser: () -> json_parser
|
278
|
+
|
279
|
+
def self.parser=: (json_parser parser) -> void
|
280
|
+
|
281
|
+
# Generate a JSON document from the Ruby data structure *obj* and return it. The
|
282
|
+
# returned document is a prettier form of the document returned by #unparse.
|
283
|
+
#
|
284
|
+
# The *opts* argument can be used to configure the generator. See the generate
|
285
|
+
# method for a more detailed explanation.
|
286
|
+
#
|
287
|
+
def self?.pretty_generate: (_ToJson obj, ?json_options opts) -> untyped
|
288
|
+
|
289
|
+
alias self.pretty_unparse self.pretty_generate
|
290
|
+
alias pretty_unparse pretty_generate
|
291
|
+
|
292
|
+
# Recursively calls passed *Proc* if the parsed data structure is an *Array* or
|
293
|
+
# *Hash*
|
294
|
+
#
|
295
|
+
def self?.recurse_proc: (untyped result) { (*untyped) -> void } -> void
|
296
|
+
|
297
|
+
alias self.restore self.load
|
298
|
+
alias restore load
|
299
|
+
|
300
|
+
# Returns the JSON generator state class that is used by JSON. This is either
|
301
|
+
# JSON::Ext::Generator::State or JSON::Pure::Generator::State.
|
302
|
+
#
|
303
|
+
def self.state: () -> json_state
|
304
|
+
|
305
|
+
def self.state=: (json_state) -> json_state
|
306
|
+
|
307
|
+
alias self.unparse self.generate
|
308
|
+
alias unparse generate
|
309
|
+
end
|
310
|
+
|
311
|
+
JSON::FAST_STATE_PROTOTYPE: json_state
|
312
|
+
|
313
|
+
JSON::Infinity: Float
|
314
|
+
|
315
|
+
JSON::JSON_LOADED: bool
|
316
|
+
|
317
|
+
JSON::MinusInfinity: Float
|
318
|
+
|
319
|
+
JSON::NaN: Float
|
320
|
+
|
321
|
+
JSON::PRETTY_STATE_PROTOTYPE: json_state
|
322
|
+
|
323
|
+
JSON::SAFE_STATE_PROTOTYPE: json_state
|
324
|
+
|
325
|
+
# JSON version
|
326
|
+
#
|
327
|
+
JSON::VERSION: String
|
328
|
+
|
329
|
+
JSON::VERSION_ARRAY: Array
|
330
|
+
|
331
|
+
JSON::VERSION_BUILD: Integer
|
332
|
+
|
333
|
+
JSON::VERSION_MAJOR: Integer
|
334
|
+
|
335
|
+
JSON::VERSION_MINOR: Integer
|
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.16.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-05-
|
11
|
+
date: 2020-05-18 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: 3.14.0.
|
193
|
+
version: 3.14.0.2
|
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: 3.14.0.
|
200
|
+
version: 3.14.0.2
|
201
201
|
description: Gradual Typing for Ruby
|
202
202
|
email:
|
203
203
|
- matsumoto@soutaro.com
|
@@ -263,6 +263,7 @@ files:
|
|
263
263
|
- lib/steep/drivers/validate.rb
|
264
264
|
- lib/steep/drivers/vendor.rb
|
265
265
|
- lib/steep/drivers/watch.rb
|
266
|
+
- lib/steep/drivers/worker.rb
|
266
267
|
- lib/steep/errors.rb
|
267
268
|
- lib/steep/interface/interface.rb
|
268
269
|
- lib/steep/interface/method.rb
|
@@ -277,6 +278,13 @@ files:
|
|
277
278
|
- lib/steep/project/hover_content.rb
|
278
279
|
- lib/steep/project/options.rb
|
279
280
|
- lib/steep/project/target.rb
|
281
|
+
- lib/steep/server/base_worker.rb
|
282
|
+
- lib/steep/server/code_worker.rb
|
283
|
+
- lib/steep/server/interaction_worker.rb
|
284
|
+
- lib/steep/server/master.rb
|
285
|
+
- lib/steep/server/signature_worker.rb
|
286
|
+
- lib/steep/server/utils.rb
|
287
|
+
- lib/steep/server/worker_process.rb
|
280
288
|
- lib/steep/signature/errors.rb
|
281
289
|
- lib/steep/signature/validator.rb
|
282
290
|
- lib/steep/source.rb
|
@@ -552,6 +560,7 @@ files:
|
|
552
560
|
- vendor/ruby-signature/stdlib/erb/erb.rbs
|
553
561
|
- vendor/ruby-signature/stdlib/find/find.rbs
|
554
562
|
- vendor/ruby-signature/stdlib/ipaddr/ipaddr.rbs
|
563
|
+
- vendor/ruby-signature/stdlib/json/json.rbs
|
555
564
|
- vendor/ruby-signature/stdlib/pathname/pathname.rbs
|
556
565
|
- vendor/ruby-signature/stdlib/prime/integer-extension.rbs
|
557
566
|
- vendor/ruby-signature/stdlib/prime/prime.rbs
|
@@ -577,7 +586,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
577
586
|
- !ruby/object:Gem::Version
|
578
587
|
version: '0'
|
579
588
|
requirements: []
|
580
|
-
rubygems_version: 3.0.
|
589
|
+
rubygems_version: 3.0.6
|
581
590
|
signing_key:
|
582
591
|
specification_version: 4
|
583
592
|
summary: Gradual Typing for Ruby
|