steep 1.6.0.pre.3 → 1.6.0

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: 89c50cdd644b4f90f2b7f5a18c262c181088eda18b116b7604f8ca4b4d17363c
4
- data.tar.gz: 6191d664a4a348dfdc43559c40a75ded920b83a2b245d28d10f84c3c72f7d324
3
+ metadata.gz: c834be3917dcff04077098f89b0300f7819b0cda30499bd11d34b172627e975f
4
+ data.tar.gz: d48ce39f9e337ad408047b56a0bb68a133ba6e044b66381c2bdd6974fcf94a69
5
5
  SHA512:
6
- metadata.gz: 833394273e491c154a8fd6ca60c693f1fd28f51d4dcb2f864c4d60abe4645e7dceb4d9914261d8237fb339e0c7f27a7625baedea3cd9ac1680d0d32a98b2867c
7
- data.tar.gz: 827261fdcffe5a0d3b32ee5771bbc6577a7a9b71a0aa2f25f3cff5eb1c6a2817e592a56f6c7189d8a028a686b7a1d8e24b313e919427c253f372de3316ed6353
6
+ metadata.gz: 1dca3fc949d3df061bf63f913eda7553c6ecb18a8a8e7f270d81ba118ca1e852326bcee836200c377b2791902e395ac112e79961b4bc614f75e6ff6fca1e5697
7
+ data.tar.gz: 30cdc11cfc25432270751e3e8c492424131055062afb5d430a415a4d2000c55b9614db304b36a051e3f42da5e0cc96335296b499a7eff41ce37d6db191e1ce01
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.6.0 (2023-11-09)
6
+
7
+ Nothing changed from 1.6.0.pre.4.
8
+
9
+ ## 1.6.0.pre.4 (2023-11-02)
10
+
11
+ ### Language server
12
+
13
+ * Fix LSP text synchronization problems ([#954](https://github.com/soutaro/steep/pull/954))
14
+
5
15
  ## 1.6.0.pre.3 (2023-11-01)
6
16
 
7
17
  ### Type checker core
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- steep (1.6.0.pre.3)
4
+ steep (1.6.0)
5
5
  activesupport (>= 5.1)
6
6
  concurrent-ruby (>= 1.1.10)
7
7
  csv (>= 3.0.9)
@@ -66,7 +66,7 @@ GEM
66
66
  racc
67
67
  psych (5.1.0)
68
68
  stringio
69
- racc (1.7.1)
69
+ racc (1.7.3)
70
70
  rainbow (3.1.1)
71
71
  rake (13.1.0)
72
72
  rb-fsevent (0.11.2)
@@ -115,18 +115,25 @@ module Steep
115
115
  code_paths.include?(path)
116
116
  end
117
117
 
118
- def add(path)
119
- return if library_path?(path) || signature_path?(path) || code_path?(path)
118
+ def add(path, library: false)
119
+ return true if signature_path?(path) || code_path?(path) || library_path?(path)
120
120
 
121
- relative_path = project.relative_path(path)
122
-
123
- case
124
- when target.source_pattern =~ relative_path
125
- code_paths << path
126
- when target.signature_pattern =~ relative_path
127
- signature_paths << path
128
- else
121
+ if library
129
122
  library_paths << path
123
+ true
124
+ else
125
+ relative_path = project.relative_path(path)
126
+
127
+ case
128
+ when target.source_pattern =~ relative_path
129
+ code_paths << path
130
+ true
131
+ when target.signature_pattern =~ relative_path
132
+ signature_paths << path
133
+ true
134
+ else
135
+ false
136
+ end
130
137
  end
131
138
  end
132
139
 
@@ -645,20 +652,22 @@ module Steep
645
652
 
646
653
  path = PathHelper.to_pathname(uri) or next
647
654
 
648
- controller.push_changes(path)
655
+ unless controller.priority_paths.include?(path)
656
+ controller.push_changes(path)
649
657
 
650
- case type
651
- when 1, 2
652
- content = path.read
653
- when 4
654
- # Deleted
655
- content = ""
656
- end
658
+ case type
659
+ when 1, 2
660
+ content = path.read
661
+ when 4
662
+ # Deleted
663
+ content = ""
664
+ end
657
665
 
658
- broadcast_notification({
659
- method: "$/file/reset",
660
- params: { uri: uri, content: content }
661
- })
666
+ broadcast_notification({
667
+ method: "$/file/reset",
668
+ params: { uri: uri, content: content }
669
+ })
670
+ end
662
671
  end
663
672
 
664
673
  if typecheck_automatically
@@ -683,6 +692,8 @@ module Steep
683
692
  start_type_checking_queue.execute do
684
693
  job_queue.push(
685
694
  -> do
695
+ Steep.logger.info { "Starting type check from textDocument/didChange notification..." }
696
+
686
697
  last_request = current_type_check_request
687
698
  if request = controller.make_request(last_request: last_request)
688
699
  start_type_check(request, last_request: last_request, start_progress: request.total > 10)
data/lib/steep/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steep
2
- VERSION = "1.6.0.pre.3"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -61,15 +61,29 @@ module Steep
61
61
 
62
62
  attr_reader target_paths: Array[TargetPaths]
63
63
 
64
+ # TargetPaths object keeps track of the expanded absolute paths of each target
65
+ #
66
+ # 1. *Library path* is a RBS file that is loaded as a part of a library
67
+ # 2. *Signature path* is a RBS file that is loaded as a part of the application library
68
+ # 3. *Code path* is a Ruby file that is being type checked
69
+ #
64
70
  class TargetPaths
65
71
  attr_reader project: Project
66
72
 
67
73
  attr_reader target: Project::Target
68
74
 
75
+ # Set of absolute paths of Ruby code
76
+ #
69
77
  attr_reader code_paths: Set[Pathname]
70
78
 
79
+ # Set of absolute paths of app signatures
80
+ #
71
81
  attr_reader signature_paths: Set[Pathname]
72
82
 
83
+ # Set of absolute paths of library signatures
84
+ #
85
+ # Unlike `code_paths` and `signature_paths`, the `library_paths` must be added explicitly not by `#add` method.
86
+ #
73
87
  attr_reader library_paths: Set[Pathname]
74
88
 
75
89
  def initialize: (project: Project, target: Project::Target) -> void
@@ -82,7 +96,14 @@ module Steep
82
96
 
83
97
  def code_path?: (Pathname path) -> bool
84
98
 
85
- def add: (Pathname path) -> void
99
+ # Adds `path` to the object
100
+ #
101
+ # Returns `false` if the path is not a part of the project.
102
+ #
103
+ # Whether `path` is a code path or signature path is automatically detected.
104
+ # `library: true` is required to add the path to library path.
105
+ #
106
+ def add: (Pathname path, ?library: bool) -> bool
86
107
 
87
108
  alias << add
88
109
  end
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.6.0.pre.3
4
+ version: 1.6.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: 2023-11-01 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -781,9 +781,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
781
781
  version: 3.0.0
782
782
  required_rubygems_version: !ruby/object:Gem::Requirement
783
783
  requirements:
784
- - - ">"
784
+ - - ">="
785
785
  - !ruby/object:Gem::Version
786
- version: 1.3.1
786
+ version: '0'
787
787
  requirements: []
788
788
  rubygems_version: 3.4.10
789
789
  signing_key: