steep 1.8.2 → 1.9.0.dev.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -12
- data/Steepfile +0 -14
- data/lib/steep/cli.rb +47 -5
- data/lib/steep/diagnostic/ruby.rb +1 -58
- data/lib/steep/drivers/annotations.rb +1 -1
- data/lib/steep/drivers/check.rb +107 -1
- data/lib/steep/drivers/checkfile.rb +10 -8
- data/lib/steep/drivers/print_project.rb +83 -40
- data/lib/steep/drivers/utils/driver_helper.rb +5 -3
- data/lib/steep/drivers/watch.rb +24 -2
- data/lib/steep/index/signature_symbol_provider.rb +8 -8
- data/lib/steep/interface/builder.rb +14 -1
- data/lib/steep/interface/function.rb +2 -2
- data/lib/steep/path_helper.rb +4 -2
- data/lib/steep/project/dsl.rb +176 -151
- data/lib/steep/project/group.rb +31 -0
- data/lib/steep/project/target.rb +32 -6
- data/lib/steep/project.rb +38 -10
- data/lib/steep/server/delay_queue.rb +0 -3
- data/lib/steep/server/interaction_worker.rb +2 -11
- data/lib/steep/server/master.rb +95 -281
- data/lib/steep/server/target_group_files.rb +205 -0
- data/lib/steep/server/type_check_controller.rb +322 -0
- data/lib/steep/server/type_check_worker.rb +60 -86
- data/lib/steep/services/file_loader.rb +23 -0
- data/lib/steep/services/goto_service.rb +40 -31
- data/lib/steep/services/hover_provider/singleton_methods.rb +4 -4
- data/lib/steep/services/path_assignment.rb +23 -4
- data/lib/steep/services/type_check_service.rb +76 -159
- data/lib/steep/signature/validator.rb +4 -4
- data/lib/steep/subtyping/check.rb +2 -2
- data/lib/steep/thread_waiter.rb +24 -16
- data/lib/steep/type_construction.rb +5 -5
- data/lib/steep/type_inference/block_params.rb +1 -2
- data/lib/steep/type_inference/context.rb +1 -1
- data/lib/steep/type_inference/type_env.rb +4 -4
- data/lib/steep/type_inference/type_env_builder.rb +1 -1
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +6 -4
- data/sample/Steepfile +6 -0
- data/sample/lib/conference.rb +1 -5
- data/steep.gemspec +7 -1
- metadata +8 -6
- data/lib/steep/drivers/validate.rb +0 -65
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: 1.
|
4
|
+
version: 1.9.0.dev.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 3.
|
101
|
+
version: 3.7.0.dev
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 3.
|
108
|
+
version: 3.7.0.dev
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: concurrent-ruby
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -304,7 +304,6 @@ files:
|
|
304
304
|
- lib/steep/drivers/stats.rb
|
305
305
|
- lib/steep/drivers/utils/driver_helper.rb
|
306
306
|
- lib/steep/drivers/utils/jobs_option.rb
|
307
|
-
- lib/steep/drivers/validate.rb
|
308
307
|
- lib/steep/drivers/vendor.rb
|
309
308
|
- lib/steep/drivers/watch.rb
|
310
309
|
- lib/steep/drivers/worker.rb
|
@@ -327,6 +326,7 @@ files:
|
|
327
326
|
- lib/steep/path_helper.rb
|
328
327
|
- lib/steep/project.rb
|
329
328
|
- lib/steep/project/dsl.rb
|
329
|
+
- lib/steep/project/group.rb
|
330
330
|
- lib/steep/project/options.rb
|
331
331
|
- lib/steep/project/pattern.rb
|
332
332
|
- lib/steep/project/target.rb
|
@@ -339,6 +339,8 @@ files:
|
|
339
339
|
- lib/steep/server/interaction_worker.rb
|
340
340
|
- lib/steep/server/lsp_formatter.rb
|
341
341
|
- lib/steep/server/master.rb
|
342
|
+
- lib/steep/server/target_group_files.rb
|
343
|
+
- lib/steep/server/type_check_controller.rb
|
342
344
|
- lib/steep/server/type_check_worker.rb
|
343
345
|
- lib/steep/server/work_done_progress.rb
|
344
346
|
- lib/steep/server/worker_process.rb
|
@@ -410,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
410
412
|
- !ruby/object:Gem::Version
|
411
413
|
version: '0'
|
412
414
|
requirements: []
|
413
|
-
rubygems_version: 3.5.
|
415
|
+
rubygems_version: 3.5.22
|
414
416
|
signing_key:
|
415
417
|
specification_version: 4
|
416
418
|
summary: Gradual Typing for Ruby
|
@@ -1,65 +0,0 @@
|
|
1
|
-
module Steep
|
2
|
-
module Drivers
|
3
|
-
class Validate
|
4
|
-
attr_reader :stdout
|
5
|
-
attr_reader :stderr
|
6
|
-
|
7
|
-
include Utils::DriverHelper
|
8
|
-
|
9
|
-
def initialize(stdout:, stderr:)
|
10
|
-
@stdout = stdout
|
11
|
-
@stderr = stderr
|
12
|
-
end
|
13
|
-
|
14
|
-
def run
|
15
|
-
project = load_config()
|
16
|
-
file_loader = Services::FileLoader.new(base_dir: project.base_dir)
|
17
|
-
|
18
|
-
any_error = false
|
19
|
-
|
20
|
-
project.targets.each do |target|
|
21
|
-
controller = Services::SignatureService.load_from(target.new_env_loader(project: project))
|
22
|
-
|
23
|
-
changes = file_loader.load_changes(target.signature_pattern, changes: {})
|
24
|
-
controller.update(changes)
|
25
|
-
|
26
|
-
errors =
|
27
|
-
Steep.measure "Validation" do
|
28
|
-
case controller.status
|
29
|
-
when Services::SignatureService::SyntaxErrorStatus, Services::SignatureService::AncestorErrorStatus
|
30
|
-
controller.status.diagnostics
|
31
|
-
when Services::SignatureService::LoadedStatus
|
32
|
-
factory = AST::Types::Factory.new(builder: controller.latest_builder)
|
33
|
-
builder = Interface::Builder.new(factory)
|
34
|
-
check = Subtyping::Check.new(builder: builder)
|
35
|
-
Signature::Validator.new(checker: check).tap {|v| v.validate() }.each_error.to_a
|
36
|
-
else
|
37
|
-
raise
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
any_error ||= !errors.empty?
|
42
|
-
|
43
|
-
formatter = Diagnostic::LSPFormatter.new({})
|
44
|
-
diagnostics = errors.group_by {|e| e.location&.buffer }.transform_values do |errors|
|
45
|
-
errors.map {|error| formatter.format(error) }
|
46
|
-
end
|
47
|
-
|
48
|
-
diagnostics.each do |buffer, ds|
|
49
|
-
if buffer
|
50
|
-
printer = DiagnosticPrinter.new(stdout: stdout, buffer: buffer)
|
51
|
-
ds.each do |d|
|
52
|
-
if d
|
53
|
-
printer.print(_ = d)
|
54
|
-
stdout.puts
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
any_error ? 1 : 0
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|