steep 1.5.0.pre.2 → 1.5.0.pre.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6cfc6dc27ad9f1d484bf734c1633319866b9c6f2593237adace2f17562dfe4b
4
- data.tar.gz: 05af58e6372461a82e0cfe3984c9694b51bb706236db7a64302e772f476efd9a
3
+ metadata.gz: 1fe028736497aa5746e128c32a325b6b98101dc30a97f82b16d572db9a3d39b8
4
+ data.tar.gz: 1ac7376836e97b860052b75aab42a08ad7a06143d8e0208c9fc764ea54e74cee
5
5
  SHA512:
6
- metadata.gz: b3b5f11e9a138fceb039c2fb7970f4fbb0b27344114427267d8d74dfab0050f299a75ee8ff6a7051ef93c353dd73f7eac74d9994f998a07360a6743e7e76a8cf
7
- data.tar.gz: d75bf5d4329e11ff68f0d61421b3c9c4cf24406959b084b4042e03210477f53469ae02bfd351834c276c9d46c9237bd4a3054a8c5a8b460e9be6f617a64f034b
6
+ metadata.gz: 9e1dbff5baebfd9ffd88390dcff4831d7d2bead258bd860fa7a6cf62e4c7880c398788c1d6f3ad163ac4256bcf9f25e59f78350a0422e4afa6ee360d38dbc876
7
+ data.tar.gz: ba0a4d84cb3a50c764369766fceae755fd6ec5717a488904db5d29f5b2ad48d05dadcec6ce37ef9092616aa540e3c513eaa526983ed15fe3096349d685aa0f24
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.5.0.pre.3 (2023-07-05)
6
+
7
+ ### Type checker core
8
+
9
+ * Resolve type names from TypeAssertion and TypeApplication ([#836](https://github.com/soutaro/steep/pull/836))
10
+
11
+ ### Commandline tool
12
+
13
+ * Replace ElseOnExhaustiveCase by UnreachableBranch from steep/diagnostic/ruby.rb ([#833](https://github.com/soutaro/steep/pull/833))
14
+
15
+ ### Language server
16
+
17
+ * Reuse the latest result to keep SignatureHelp opened while typing ([#835](https://github.com/soutaro/steep/pull/835))
18
+
5
19
  ## 1.5.0.pre.2 (2023-07-05)
6
20
 
7
21
  ### Language server
@@ -21,6 +35,10 @@
21
35
  * Fix type assertion parsing error ([#805](https://github.com/soutaro/steep/pull/805))
22
36
  * Distribute `untyped` to block params ([#798](https://github.com/soutaro/steep/pull/798))
23
37
  * Should escape underscore for method name ([#770](https://github.com/soutaro/steep/pull/770))
38
+ * Give a special typing rule to `#lambda` calls ([#811](https://github.com/soutaro/steep/pull/811))
39
+ * Support early return code using "and return" ([#828](https://github.com/soutaro/steep/pull/828))
40
+ * Validate type applications in ancestors ([#810](https://github.com/soutaro/steep/pull/810))
41
+ * Convert block-pass-arguments with `#to_proc` ([#806](https://github.com/soutaro/steep/pull/806))
24
42
 
25
43
  ### Commandline tool
26
44
 
@@ -38,11 +56,14 @@
38
56
 
39
57
  * Completion in annotations ([#818](https://github.com/soutaro/steep/pull/818))
40
58
  * Implement *go to type definition* ([#784](https://github.com/soutaro/steep/pull/784))
59
+ * completion: Support completion for optional chaining (&.) ([#827](https://github.com/soutaro/steep/pull/827))
60
+ * signature helps are not shown if the target code has comments ([#829](https://github.com/soutaro/steep/pull/829))
41
61
 
42
62
  ### Miscellaneous
43
63
 
44
64
  * Typecheck sources ([#820](https://github.com/soutaro/steep/pull/820))
45
65
  * Relax concurrent-ruby requirement ([#812](https://github.com/soutaro/steep/pull/812))
66
+ * Cast from union for faster type checking ([#830](https://github.com/soutaro/steep/pull/830))
46
67
 
47
68
  ## 1.4.0 (2023-04-25)
48
69
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- steep (1.5.0.pre.2)
4
+ steep (1.5.0.pre.3)
5
5
  activesupport (>= 5.1)
6
6
  concurrent-ruby (>= 1.1.10)
7
7
  csv (>= 3.0.9)
@@ -25,6 +25,8 @@ module Steep
25
25
  end
26
26
 
27
27
  def types(context, subtyping, type_vars)
28
+ resolver = RBS::Resolver::TypeNameResolver.new(subtyping.factory.env)
29
+
28
30
  # @type var types: Array[Types::t]
29
31
  types = []
30
32
 
@@ -32,6 +34,7 @@ module Steep
32
34
 
33
35
  while true
34
36
  ty = RBS::Parser.parse_type(loc.buffer, range: loc.range, variables: type_vars) or break
37
+ ty = ty.map_type_name {|name| resolver.resolve(name, context: context) || name.absolute! }
35
38
 
36
39
  validator = Signature::Validator.new(checker: subtyping)
37
40
  validator.validate_type(ty)
@@ -41,7 +44,7 @@ module Steep
41
44
  end
42
45
 
43
46
  ty = subtyping.factory.type(ty)
44
- types << subtyping.factory.absolute_type(ty, context: context)
47
+ types << ty
45
48
 
46
49
  match = RBS::Location.new(loc.buffer, ty.location.end_pos, type_location.end_pos).source.match(/\A\s*,\s*/) or break
47
50
  offset = match.length
@@ -18,12 +18,14 @@ module Steep
18
18
 
19
19
  def type(context, subtyping, type_vars)
20
20
  if ty = RBS::Parser.parse_type(type_location.buffer, range: type_location.range, variables: type_vars, require_eof: true)
21
+ resolver = RBS::Resolver::TypeNameResolver.new(subtyping.factory.env)
22
+ ty = ty.map_type_name {|name| resolver.resolve(name, context: context) || name.absolute! }
23
+
21
24
  validator = Signature::Validator.new(checker: subtyping)
22
25
  validator.validate_type(ty)
23
26
 
24
27
  unless validator.has_error?
25
- ty = subtyping.factory.type(ty)
26
- subtyping.factory.absolute_type(ty, context: context)
28
+ subtyping.factory.type(ty)
27
29
  end
28
30
  else
29
31
  nil
@@ -968,7 +968,7 @@ module Steep
968
968
  {
969
969
  ImplicitBreakValueMismatch => :warning,
970
970
  FallbackAny => :information,
971
- ElseOnExhaustiveCase => :warning,
971
+ UnreachableBranch => :warning,
972
972
  UnknownConstant => :warning,
973
973
  MethodDefinitionMissing => :information,
974
974
  FalseAssertion => :information,
@@ -989,7 +989,7 @@ module Steep
989
989
  NoMethod => nil,
990
990
  ImplicitBreakValueMismatch => nil,
991
991
  FallbackAny => nil,
992
- ElseOnExhaustiveCase => nil,
992
+ UnreachableBranch => nil,
993
993
  UnknownConstant => nil,
994
994
  MethodDefinitionMissing => nil,
995
995
  UnsupportedSyntax => nil,
@@ -1006,7 +1006,7 @@ module Steep
1006
1006
  NoMethod => nil,
1007
1007
  ImplicitBreakValueMismatch => nil,
1008
1008
  FallbackAny => nil,
1009
- ElseOnExhaustiveCase => nil,
1009
+ UnreachableBranch => nil,
1010
1010
  UnknownConstant => nil,
1011
1011
  MethodDefinitionMissing => nil,
1012
1012
  UnexpectedJump => nil,
@@ -406,7 +406,8 @@ module Steep
406
406
  )
407
407
  end
408
408
 
409
- LSP::Interface::SignatureHelp.new(
409
+ @last_signature_help_line = job.line
410
+ @last_signature_help_result = LSP::Interface::SignatureHelp.new(
410
411
  signatures: signatures,
411
412
  active_signature: index
412
413
  )
@@ -414,7 +415,8 @@ module Steep
414
415
  end
415
416
  end
416
417
  rescue Parser::SyntaxError
417
- # Ignore syntax error
418
+ # Reuse the latest result to keep SignatureHelp opened while typing
419
+ @last_signature_help_result if @last_signature_help_line == job.line
418
420
  end
419
421
  end
420
422
  end
data/lib/steep/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steep
2
- VERSION = "1.5.0.pre.2"
2
+ VERSION = "1.5.0.pre.3"
3
3
  end
@@ -52,6 +52,10 @@ module Steep
52
52
 
53
53
  module LSP = LanguageServer::Protocol
54
54
 
55
+ @last_signature_help_line: Integer
56
+
57
+ @last_signature_help_result: LanguageServer::Protocol::Interface::SignatureHelp
58
+
55
59
  attr_reader service: Services::TypeCheckService
56
60
 
57
61
  def initialize: (project: Project, reader: Reader, writer: Writer, ?queue: Queue) -> void
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.pre.2
4
+ version: 1.5.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto