steep 1.8.0 → 1.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 298dd973658fa586efbf59424298b54eb540a3e8f5b5c423f10ede9ae83d0d65
4
- data.tar.gz: f9a21241e44c10744d3305111b9afe499855931acda999b8671a2276ade4b2d9
3
+ metadata.gz: 1619c69c7c85bbe5f0dffc4826aabf3e5a4ffa46c4eba61bab5a47ef29957d65
4
+ data.tar.gz: 25540890ecd3d6b7dfa2cd280c65da59b7ec65e520942fa09175908d3bfe124a
5
5
  SHA512:
6
- metadata.gz: e110b36e04ba367ba26ce2f2a74b7aa6be20bb25df742af696803be795f7b372a92948f923c4b30548ad4c78657b0dcb19702a602721ef80136eb4f9d4e9daa1
7
- data.tar.gz: 2a4e44c76e29539b8692e31aa5cdd3f438715b978ef5d4e264d26191f634ff3c0ff58488d0334816ca8e6e6b1ff0ce3d0a35140c51e1dea78d7e3b56a31a3fdd
6
+ metadata.gz: 3715058e9bf76839a0072e3f5e01fbcce25913e0a23b03ae645644b8c88f0f5160264ce3aa989c391a3b81ee04c7104670f0c77ce3c8192a847909c6f4e8fa9d
7
+ data.tar.gz: 759e541a4444b02c2c86a8adbab2c606e667010c427146d4e74a61d422ddd55ce70ef30953d1ad94a7f1afea0a216f9e6198ffab71693b0bb7370819cc52707e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.8.1 (2024-10-08)
4
+
5
+ ### Language server
6
+
7
+ * Skip sending response to `$/steep/typecheck` request from `steep langserver` ([#1268](https://github.com/soutaro/steep/pull/1268), backport [#1267](https://github.com/soutaro/steep/pull/1267))
8
+
3
9
  ## 1.8.0 (2024-09-30)
4
10
 
5
11
  ### Type checker core
@@ -165,6 +165,7 @@ module Steep
165
165
  request.signature_paths << project.absolute_path(path)
166
166
  end
167
167
 
168
+ request.needs_response = true
168
169
  master.start_type_check(request: request, last_request: nil, report_progress_threshold: 0)
169
170
 
170
171
  Steep.logger.info { "Starting type checking: #{request_guid}" }
@@ -162,7 +162,7 @@ module Steep
162
162
  master.job_queue << -> do
163
163
  Steep.logger.info { "Type checking for stats..." }
164
164
  progress = master.work_done_progress(typecheck_guid)
165
- master.start_type_check(last_request: nil, progress: progress, include_unchanged: true, report_progress_threshold: 0)
165
+ master.start_type_check(last_request: nil, progress: progress, include_unchanged: true, report_progress_threshold: 0, needs_response: true)
166
166
  end
167
167
  wait_for_message(reader: client_reader) do |message|
168
168
  message[:id] == typecheck_guid
@@ -12,6 +12,7 @@ module Steep
12
12
  attr_reader :checked_paths
13
13
  attr_reader :work_done_progress
14
14
  attr_reader :started_at
15
+ attr_accessor :needs_response
15
16
 
16
17
  def initialize(guid:, progress:)
17
18
  @guid = guid
@@ -22,6 +23,7 @@ module Steep
22
23
  @checked_paths = Set[]
23
24
  @work_done_progress = progress
24
25
  @started_at = Time.now
26
+ @needs_response = false
25
27
  end
26
28
 
27
29
  def uri(path)
@@ -732,7 +734,8 @@ module Steep
732
734
  start_type_check(
733
735
  last_request: last_request,
734
736
  include_unchanged: true,
735
- progress: work_done_progress(guid)
737
+ progress: work_done_progress(guid),
738
+ needs_response: false
736
739
  )
737
740
  end
738
741
  )
@@ -755,7 +758,8 @@ module Steep
755
758
 
756
759
  start_type_check(
757
760
  last_request: last_request,
758
- progress: work_done_progress(guid)
761
+ progress: work_done_progress(guid),
762
+ needs_response: false
759
763
  )
760
764
  end
761
765
  )
@@ -859,7 +863,8 @@ module Steep
859
863
  start_type_check(
860
864
  last_request: current_type_check_request,
861
865
  include_unchanged: true,
862
- progress: work_done_progress(guid || SecureRandom.uuid)
866
+ progress: work_done_progress(guid || SecureRandom.uuid),
867
+ needs_response: true
863
868
  )
864
869
 
865
870
  when "$/ping"
@@ -920,25 +925,27 @@ module Steep
920
925
  finished_at = Time.now
921
926
  duration = finished_at - request.started_at
922
927
 
923
- enqueue_write_job(
924
- SendMessageJob.to_client(
925
- message: CustomMethods::TypeCheck.response(
926
- request.guid,
927
- {
928
- guid: request.guid,
929
- completed: request.finished?,
930
- started_at: request.started_at.iso8601,
931
- finished_at: finished_at.iso8601,
932
- duration: duration.to_i
933
- }
928
+ if request.needs_response
929
+ enqueue_write_job(
930
+ SendMessageJob.to_client(
931
+ message: CustomMethods::TypeCheck.response(
932
+ request.guid,
933
+ {
934
+ guid: request.guid,
935
+ completed: request.finished?,
936
+ started_at: request.started_at.iso8601,
937
+ finished_at: finished_at.iso8601,
938
+ duration: duration.to_i
939
+ }
940
+ )
934
941
  )
935
942
  )
936
- )
937
-
938
- nil
943
+ else
944
+ Steep.logger.debug { "Skip sending response to #{CustomMethods::TypeCheck::METHOD} request" }
945
+ end
939
946
  end
940
947
 
941
- def start_type_check(request: nil, last_request:, progress: nil, include_unchanged: false, report_progress_threshold: 10)
948
+ def start_type_check(request: nil, last_request:, progress: nil, include_unchanged: false, report_progress_threshold: 10, needs_response: nil)
942
949
  Steep.logger.tagged "#start_type_check(#{progress&.guid || request&.guid}, #{last_request&.guid}" do
943
950
  if last_request
944
951
  finish_type_check(last_request)
@@ -947,6 +954,7 @@ module Steep
947
954
  unless request
948
955
  progress or raise
949
956
  request = controller.make_request(guid: progress.guid, include_unchanged: include_unchanged, progress: progress) or return
957
+ request.needs_response = needs_response ? true : false
950
958
  end
951
959
 
952
960
  if request.total > report_progress_threshold
@@ -960,7 +968,8 @@ module Steep
960
968
  end
961
969
 
962
970
  if request.finished?
963
- @current_type_check_request = finish_type_check(request)
971
+ finish_type_check(request)
972
+ @current_type_check_request = nil
964
973
  return
965
974
  end
966
975
  else
@@ -992,7 +1001,8 @@ module Steep
992
1001
  current.work_done_progress.report(percentage, "#{percentage}%")
993
1002
 
994
1003
  if current.finished?
995
- @current_type_check_request = finish_type_check(current)
1004
+ finish_type_check(current)
1005
+ @current_type_check_request = nil
996
1006
  end
997
1007
  end
998
1008
  end
data/lib/steep/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steep
2
- VERSION = "1.8.0"
2
+ VERSION = "1.8.1"
3
3
  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.8.0
4
+ version: 1.8.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-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -410,7 +410,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  - !ruby/object:Gem::Version
411
411
  version: '0'
412
412
  requirements: []
413
- rubygems_version: 3.5.11
413
+ rubygems_version: 3.5.17
414
414
  signing_key:
415
415
  specification_version: 4
416
416
  summary: Gradual Typing for Ruby