steep 1.9.2 → 1.9.4
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/CHANGELOG.md +17 -0
- data/Steepfile +2 -0
- data/lib/steep/annotation_parser.rb +2 -2
- data/lib/steep/ast/builtin.rb +1 -1
- data/lib/steep/interface/builder.rb +2 -2
- data/lib/steep/interface/type_param.rb +1 -1
- data/lib/steep/method_name.rb +2 -2
- data/lib/steep/server/lsp_formatter.rb +1 -1
- data/lib/steep/server/master.rb +55 -45
- data/lib/steep/type_construction.rb +2 -2
- data/lib/steep/version.rb +1 -1
- data/steep.gemspec +1 -1
- metadata +5 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b23b392399196d67221acd72708ebe27ee3b7bbb7b54e4b5922e8ecbb6ceb5e3
|
4
|
+
data.tar.gz: a315e09c38f8736bc66aad3a57275f8546c28c75845fa33a9de375387cc63a13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe50cd4df36c00affa8868857d55deeea0e58c36372260209d95fabec69eb9f005d37581c5184c0b44e3a5fb1d42bd5bb25a5630c5dfafa4552b08a8fb87377
|
7
|
+
data.tar.gz: bc41b2386db2d9a97dabf2c81ff2079c6fac875decc01ba223d1475473048945d81ba43cc17f0db24f6ba2da285954dff83e10910b5f3831716781698b458d9e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.9.4 (2025-02-04)
|
4
|
+
|
5
|
+
### Language server
|
6
|
+
|
7
|
+
* Set up file watcher for groups ([#1485](https://github.com/soutaro/steep/pull/1485), Backported)
|
8
|
+
|
9
|
+
### Miscellaneous
|
10
|
+
|
11
|
+
* Fix CI ([#1486](https://github.com/soutaro/steep/pull/1486), Backported)
|
12
|
+
|
13
|
+
## 1.9.3 (2024-12-26)
|
14
|
+
|
15
|
+
### Miscellaneous
|
16
|
+
|
17
|
+
* Steep 1.9.1 ([#1398](https://github.com/soutaro/steep/pull/1398))
|
18
|
+
* Update rbs ([#1443](https://github.com/soutaro/steep/pull/1443))
|
19
|
+
|
3
20
|
## 1.9.2 (2024-12-16)
|
4
21
|
|
5
22
|
### Type checker core
|
data/Steepfile
CHANGED
@@ -104,7 +104,7 @@ module Steep
|
|
104
104
|
name = match[:name] or raise
|
105
105
|
type = parse_type(match, location: location)
|
106
106
|
|
107
|
-
AST::Annotation::ConstType.new(name: TypeName(name), type: type, location: location)
|
107
|
+
AST::Annotation::ConstType.new(name: RBS::TypeName.parse(name), type: type, location: location)
|
108
108
|
end
|
109
109
|
|
110
110
|
when keyword_subject_type("ivar", IVAR_NAME)
|
@@ -184,7 +184,7 @@ module Steep
|
|
184
184
|
when /@implements\s+(?<name>#{CONST_NAME})#{TYPE_PARAMS}$/
|
185
185
|
Regexp.last_match.yield_self do |match|
|
186
186
|
match or raise
|
187
|
-
type_name = TypeName(match[:name] || raise)
|
187
|
+
type_name = RBS::TypeName.parse(match[:name] || raise)
|
188
188
|
params = match[:params]&.yield_self {|params| params.split(/,/).map {|param| param.strip.to_sym } } || []
|
189
189
|
|
190
190
|
name = AST::Annotation::Implements::Module.new(name: type_name, args: params)
|
data/lib/steep/ast/builtin.rb
CHANGED
@@ -786,7 +786,7 @@ module Steep
|
|
786
786
|
RBS::BuiltinNames::Symbol.name,
|
787
787
|
RBS::BuiltinNames::TrueClass.name,
|
788
788
|
RBS::BuiltinNames::FalseClass.name,
|
789
|
-
TypeName("::NilClass")
|
789
|
+
RBS::TypeName.parse("::NilClass")
|
790
790
|
# Value based type-case works on literal types which is available for String, Integer, Symbol, TrueClass, FalseClass, and NilClass
|
791
791
|
return method_type.with(
|
792
792
|
type: method_type.type.with(
|
@@ -828,7 +828,7 @@ module Steep
|
|
828
828
|
|
829
829
|
def add_implicitly_returns_nil(annotations, method_type)
|
830
830
|
return method_type unless implicitly_returns_nil
|
831
|
-
|
831
|
+
|
832
832
|
if annotations.find { _1.string == "implicitly-returns-nil" }
|
833
833
|
return_type = method_type.type.return_type
|
834
834
|
method_type = method_type.with(
|
data/lib/steep/method_name.rb
CHANGED
@@ -28,12 +28,12 @@ module Steep
|
|
28
28
|
type_name, method_name = string.split(/#/, 2)
|
29
29
|
type_name or raise
|
30
30
|
method_name or raise
|
31
|
-
InstanceMethodName.new(type_name: TypeName(type_name), method_name: method_name.to_sym)
|
31
|
+
InstanceMethodName.new(type_name: RBS::TypeName.parse(type_name), method_name: method_name.to_sym)
|
32
32
|
when /\./
|
33
33
|
type_name, method_name = string.split(/\./, 2)
|
34
34
|
type_name or raise
|
35
35
|
method_name or raise
|
36
|
-
SingletonMethodName.new(type_name: TypeName(type_name), method_name: method_name.to_sym)
|
36
|
+
SingletonMethodName.new(type_name: RBS::TypeName.parse(type_name), method_name: method_name.to_sym)
|
37
37
|
else
|
38
38
|
raise "Unexpected method name: #{string}"
|
39
39
|
end
|
data/lib/steep/server/master.rb
CHANGED
@@ -413,49 +413,7 @@ module Steep
|
|
413
413
|
end
|
414
414
|
|
415
415
|
if file_system_watcher_supported?
|
416
|
-
|
417
|
-
project.targets.each do |target|
|
418
|
-
target.source_pattern.patterns.each do |pat|
|
419
|
-
path = project.base_dir + pat
|
420
|
-
patterns << path.to_s unless path.directory?
|
421
|
-
end
|
422
|
-
target.source_pattern.prefixes.each do |pat|
|
423
|
-
path = project.base_dir + pat
|
424
|
-
patterns << (path + "**/*.rb").to_s unless path.file?
|
425
|
-
end
|
426
|
-
target.signature_pattern.patterns.each do |pat|
|
427
|
-
path = project.base_dir + pat
|
428
|
-
patterns << path.to_s unless path.directory?
|
429
|
-
end
|
430
|
-
target.signature_pattern.prefixes.each do |pat|
|
431
|
-
path = project.base_dir + pat
|
432
|
-
patterns << (path + "**/*.rbs").to_s unless path.file?
|
433
|
-
end
|
434
|
-
end
|
435
|
-
patterns.sort!
|
436
|
-
patterns.uniq!
|
437
|
-
|
438
|
-
Steep.logger.info { "Setting up didChangeWatchedFiles with pattern: #{patterns.inspect}" }
|
439
|
-
|
440
|
-
enqueue_write_job SendMessageJob.to_client(
|
441
|
-
message: {
|
442
|
-
id: SecureRandom.uuid,
|
443
|
-
method: "client/registerCapability",
|
444
|
-
params: {
|
445
|
-
registrations: [
|
446
|
-
{
|
447
|
-
id: SecureRandom.uuid,
|
448
|
-
method: "workspace/didChangeWatchedFiles",
|
449
|
-
registerOptions: {
|
450
|
-
watchers: patterns.map do |pattern|
|
451
|
-
{ globPattern: pattern }
|
452
|
-
end
|
453
|
-
}
|
454
|
-
}
|
455
|
-
]
|
456
|
-
}
|
457
|
-
}
|
458
|
-
)
|
416
|
+
setup_file_system_watcher()
|
459
417
|
end
|
460
418
|
|
461
419
|
controller.changed_paths.clear()
|
@@ -635,7 +593,7 @@ module Steep
|
|
635
593
|
enqueue_write_job SendMessageJob.to_client(
|
636
594
|
message: {
|
637
595
|
id: message[:id],
|
638
|
-
result: []
|
596
|
+
result: [] #: Array[untyped]
|
639
597
|
}
|
640
598
|
)
|
641
599
|
end
|
@@ -800,7 +758,7 @@ module Steep
|
|
800
758
|
Steep.logger.info "Starting new progress..."
|
801
759
|
|
802
760
|
@current_type_check_request = request
|
803
|
-
|
761
|
+
|
804
762
|
if progress
|
805
763
|
# If `request:` keyword arg is not given
|
806
764
|
request.work_done_progress.begin("Type checking", request_id: fresh_request_id)
|
@@ -907,6 +865,58 @@ module Steep
|
|
907
865
|
)
|
908
866
|
end
|
909
867
|
end
|
868
|
+
|
869
|
+
def setup_file_system_watcher()
|
870
|
+
patterns = [] #: Array[String]
|
871
|
+
|
872
|
+
project.targets.each do |target|
|
873
|
+
patterns.concat(paths_to_watch(target.source_pattern, extname: ".rb"))
|
874
|
+
patterns.concat(paths_to_watch(target.signature_pattern, extname: ".rbs"))
|
875
|
+
target.groups.each do |group|
|
876
|
+
patterns.concat(paths_to_watch(group.source_pattern, extname: ".rb"))
|
877
|
+
patterns.concat(paths_to_watch(group.signature_pattern, extname: ".rbs"))
|
878
|
+
end
|
879
|
+
end
|
880
|
+
patterns.sort!
|
881
|
+
patterns.uniq!
|
882
|
+
|
883
|
+
Steep.logger.info { "Setting up didChangeWatchedFiles with pattern: #{patterns.inspect}" }
|
884
|
+
|
885
|
+
enqueue_write_job SendMessageJob.to_client(
|
886
|
+
message: {
|
887
|
+
id: SecureRandom.uuid,
|
888
|
+
method: "client/registerCapability",
|
889
|
+
params: {
|
890
|
+
registrations: [
|
891
|
+
{
|
892
|
+
id: SecureRandom.uuid,
|
893
|
+
method: "workspace/didChangeWatchedFiles",
|
894
|
+
registerOptions: {
|
895
|
+
watchers: patterns.map do |pattern|
|
896
|
+
{ globPattern: pattern }
|
897
|
+
end
|
898
|
+
}
|
899
|
+
}
|
900
|
+
]
|
901
|
+
}
|
902
|
+
}
|
903
|
+
)
|
904
|
+
end
|
905
|
+
|
906
|
+
def paths_to_watch(pattern, extname:)
|
907
|
+
result = [] #: Array[String]
|
908
|
+
|
909
|
+
pattern.patterns.each do |pat|
|
910
|
+
path = project.base_dir + pat
|
911
|
+
result << path.to_s unless path.directory?
|
912
|
+
end
|
913
|
+
pattern.prefixes.each do |pat|
|
914
|
+
path = project.base_dir + pat
|
915
|
+
result << (path + "**/*#{extname}").to_s unless path.file?
|
916
|
+
end
|
917
|
+
|
918
|
+
result
|
919
|
+
end
|
910
920
|
end
|
911
921
|
end
|
912
922
|
end
|
@@ -1385,10 +1385,10 @@ module Steep
|
|
1385
1385
|
add_typing(node, type: AST::Builtin::Float.instance_type)
|
1386
1386
|
|
1387
1387
|
when :rational
|
1388
|
-
add_typing(node, type: AST::Types::Name::Instance.new(name: TypeName("::Rational"), args: []))
|
1388
|
+
add_typing(node, type: AST::Types::Name::Instance.new(name: RBS::TypeName.parse("::Rational"), args: []))
|
1389
1389
|
|
1390
1390
|
when :complex
|
1391
|
-
add_typing(node, type: AST::Types::Name::Instance.new(name: TypeName("::Complex"), args: []))
|
1391
|
+
add_typing(node, type: AST::Types::Name::Instance.new(name: RBS::TypeName.parse("::Complex"), args: []))
|
1392
1392
|
|
1393
1393
|
when :nil
|
1394
1394
|
add_typing(node, type: AST::Builtin.nil_type)
|
data/lib/steep/version.rb
CHANGED
data/steep.gemspec
CHANGED
@@ -42,7 +42,7 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.add_runtime_dependency "rainbow", ">= 2.2.2", "< 4.0"
|
43
43
|
spec.add_runtime_dependency "listen", "~> 3.0"
|
44
44
|
spec.add_runtime_dependency "language_server-protocol", ">= 3.15", "< 4.0"
|
45
|
-
spec.add_runtime_dependency "rbs", "~> 3.
|
45
|
+
spec.add_runtime_dependency "rbs", "~> 3.8"
|
46
46
|
spec.add_runtime_dependency "concurrent-ruby", ">= 1.1.10"
|
47
47
|
spec.add_runtime_dependency "terminal-table", ">= 2", "< 4"
|
48
48
|
spec.add_runtime_dependency "securerandom", ">= 0.1"
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: parser
|
@@ -98,14 +97,14 @@ dependencies:
|
|
98
97
|
requirements:
|
99
98
|
- - "~>"
|
100
99
|
- !ruby/object:Gem::Version
|
101
|
-
version: 3.
|
100
|
+
version: '3.8'
|
102
101
|
type: :runtime
|
103
102
|
prerelease: false
|
104
103
|
version_requirements: !ruby/object:Gem::Requirement
|
105
104
|
requirements:
|
106
105
|
- - "~>"
|
107
106
|
- !ruby/object:Gem::Version
|
108
|
-
version: 3.
|
107
|
+
version: '3.8'
|
109
108
|
- !ruby/object:Gem::Dependency
|
110
109
|
name: concurrent-ruby
|
111
110
|
requirement: !ruby/object:Gem::Requirement
|
@@ -415,7 +414,6 @@ metadata:
|
|
415
414
|
homepage_uri: https://github.com/soutaro/steep
|
416
415
|
source_code_uri: https://github.com/soutaro/steep
|
417
416
|
changelog_uri: https://github.com/soutaro/steep/blob/master/CHANGELOG.md
|
418
|
-
post_install_message:
|
419
417
|
rdoc_options: []
|
420
418
|
require_paths:
|
421
419
|
- lib
|
@@ -430,8 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
430
428
|
- !ruby/object:Gem::Version
|
431
429
|
version: '0'
|
432
430
|
requirements: []
|
433
|
-
rubygems_version: 3.
|
434
|
-
signing_key:
|
431
|
+
rubygems_version: 3.6.2
|
435
432
|
specification_version: 4
|
436
433
|
summary: Gradual Typing for Ruby
|
437
434
|
test_files: []
|