steep 1.6.0.pre.3 → 1.6.0.pre.4

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: 9d612ef62eb6e7c7e280b918e6cf1bfbcaac06346f4a49b18f61db5cc277798d
4
+ data.tar.gz: 04c2542f6fc1b05f6c1a36ac470b85d90cbe9a1af5eb82bda37be5a41cc93b14
5
5
  SHA512:
6
- metadata.gz: 833394273e491c154a8fd6ca60c693f1fd28f51d4dcb2f864c4d60abe4645e7dceb4d9914261d8237fb339e0c7f27a7625baedea3cd9ac1680d0d32a98b2867c
7
- data.tar.gz: 827261fdcffe5a0d3b32ee5771bbc6577a7a9b71a0aa2f25f3cff5eb1c6a2817e592a56f6c7189d8a028a686b7a1d8e24b313e919427c253f372de3316ed6353
6
+ metadata.gz: 48bc0af1c2ad26831d11588e2224eb6b45fe71f45faa3d030475402260e6f693b8a528d6831e2619b68e76359264a1d8445c8902efe6aaefc2adfe3c8fc8513c
7
+ data.tar.gz: c61112bbc9cc29bf805fe12cc4b21352e7603252538440952e63af19888f34219131e38726b181238c052c09b479d3a1e4d2c23adf4d70e1f004ed207dccb796
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.6.0.pre.4 (2023-11-02)
6
+
7
+ ### Language server
8
+
9
+ * Fix LSP text synchronization problems ([#954](https://github.com/soutaro/steep/pull/954))
10
+
5
11
  ## 1.6.0.pre.3 (2023-11-01)
6
12
 
7
13
  ### 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.pre.4)
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.2)
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.pre.4"
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.pre.4
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-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser