ruby-lsp 0.23.9 → 0.23.10

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: 149e7978a6f85c9349fa3922283a151f2e2129d12eb14e29d665ad35a3b909e7
4
- data.tar.gz: a931c7b049810fe304eaa93ae4a7a8bdd499951fa9f3ca21b6da9df91cc24e12
3
+ metadata.gz: 3a0d78055f2f6bf861e581a5b5a2d1321d3a8452b23d638becb6e64da925d842
4
+ data.tar.gz: '0397aa5a123ed08757606db1be3690b50cba847a372f52da25fb64a6fb5816ce'
5
5
  SHA512:
6
- metadata.gz: 6fae90263d8e037d3e58a0f20de4e6eaa671d739f28fa1af90a013a9d0ade3a43fa118b5fe15c3e2a3de025a9c3e4a53dc4584426678619896b98d38cca2dcbc
7
- data.tar.gz: c634542b0ec26e9df418222b8eab459f42d3f65e42c196c6a3769139073c94f98bfb0da8cb61b18f055629aa9fbf58d6516d13a40b453f27fbc4a6f1514d3d9d
6
+ metadata.gz: a14d101646bd32467724aeedb60892c5c06e775a57d749623cc1e76dbc42ee6d82eca10e2fa1149900365eff59ee57c20300bb043a3fdcf1330961b6bbd94918
7
+ data.tar.gz: 23b339c5854620771e7b505381dad64cf3e8d89ed2850a19c7a299e72d2363202e1e74327c05d27d8fb7fae508abb7141e5a858319b2841c8c914233e28e076e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.23.9
1
+ 0.23.10
@@ -32,6 +32,9 @@ module RubyLsp
32
32
  sig { returns(URI::Generic) }
33
33
  attr_reader :workspace_uri
34
34
 
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :telemetry_machine_id
37
+
35
38
  sig { void }
36
39
  def initialize
37
40
  @workspace_uri = T.let(URI::Generic.from_path(path: Dir.pwd), URI::Generic)
@@ -57,6 +60,7 @@ module RubyLsp
57
60
  @client_capabilities = T.let(ClientCapabilities.new, ClientCapabilities)
58
61
  @enabled_feature_flags = T.let({}, T::Hash[Symbol, T::Boolean])
59
62
  @mutex = T.let(Mutex.new, Mutex)
63
+ @telemetry_machine_id = T.let(nil, T.nilable(String))
60
64
  end
61
65
 
62
66
  sig { type_parameters(:T).params(block: T.proc.returns(T.type_parameter(:T))).returns(T.type_parameter(:T)) }
@@ -175,6 +179,7 @@ module RubyLsp
175
179
  enabled_flags = options.dig(:initializationOptions, :enabledFeatureFlags)
176
180
  @enabled_feature_flags = enabled_flags if enabled_flags
177
181
 
182
+ @telemetry_machine_id = options.dig(:initializationOptions, :telemetryMachineId)
178
183
  notifications
179
184
  end
180
185
 
@@ -471,6 +471,9 @@ module RubyLsp
471
471
  path_node_to_complete,
472
472
  )
473
473
  end
474
+ rescue Errno::EPERM
475
+ # If the user writes a relative require pointing to a path that the editor has no permissions to read, then glob
476
+ # might fail with EPERM
474
477
  end
475
478
 
476
479
  sig { params(node: Prism::CallNode, name: String).void }
@@ -1032,7 +1032,14 @@ module RubyLsp
1032
1032
  end
1033
1033
  end
1034
1034
 
1035
- Addon.file_watcher_addons.each { |addon| T.unsafe(addon).workspace_did_change_watched_files(changes) }
1035
+ Addon.file_watcher_addons.each do |addon|
1036
+ T.unsafe(addon).workspace_did_change_watched_files(changes)
1037
+ rescue => e
1038
+ send_log_message(
1039
+ "Error in #{addon.name} add-on while processing watched file notifications: #{e.full_message}",
1040
+ type: Constant::MessageType::ERROR,
1041
+ )
1042
+ end
1036
1043
  end
1037
1044
 
1038
1045
  sig { params(index: RubyIndexer::Index, file_path: String, change_type: Integer).void }
@@ -1044,9 +1051,13 @@ module RubyLsp
1044
1051
 
1045
1052
  case change_type
1046
1053
  when Constant::FileChangeType::CREATED
1047
- index.index_single(uri, content)
1054
+ # If we receive a late created notification for a file that has already been claimed by the client, we want to
1055
+ # handle change for that URI so that the require path tree is updated
1056
+ @store.key?(uri) ? index.handle_change(uri, content) : index.index_single(uri, content)
1048
1057
  when Constant::FileChangeType::CHANGED
1049
- index.handle_change(uri, content)
1058
+ # We only handle changes on file watched notifications if the client is not the one managing this URI.
1059
+ # Otherwise, these changes are handled when running the combined requests
1060
+ index.handle_change(uri, content) unless @store.key?(uri)
1050
1061
  when Constant::FileChangeType::DELETED
1051
1062
  index.delete(uri)
1052
1063
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.9
4
+ version: 0.23.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-06 00:00:00.000000000 Z
10
+ date: 2025-02-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: language_server-protocol