ruby-lsp-rails 0.3.23 → 0.3.25

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: 03f59a93f09d79b974b5a46176ef8d2745e361bce2247ca19bef22e72aa697f8
4
- data.tar.gz: 7e65330c616d0db49d4d54f084284ac8fd9d181b271e68dce3f3408a66d81daf
3
+ metadata.gz: 03b28222188faf1ac819337e73c244ba0a3cb588acfb286554246151b4beaa1a
4
+ data.tar.gz: 5558fe8142c90eaa53991f99a54da04b1cf1fe2ded213ae737b55cc9ad8acd78
5
5
  SHA512:
6
- metadata.gz: 1d92c385c3e6b7e1615213434791295bc2e6488d6e3dd853946c2c1f59345a2e0dd44a1e3019ca46293b8f48423a656f6e756941fc4da5eb371fd084735b5bce
7
- data.tar.gz: ac372a79150173f46c8ec6d72e686785f41b98d1d986502c360e91d5fb461e8b2a7bd4a348f617365fd42c4863b7c008e140d545c06639dbcb5946dd2ed33a10
6
+ metadata.gz: fb20529701e3008b9f38ba4840446aed72aad85b9e623bc93f691a7bee1ce0418d0b2bfabef085d5446fced0f645c0f6325dd4e78925f2e3ab20cc43e1d34543
7
+ data.tar.gz: e8507ef9f18e3987c667f1c45a3419171677f318bfb4ba5572153efea73bf2ec2922a0ec62865d3aabc9e49117af8e86951975a9eadc68d7848ce6d57f75fdb2
@@ -43,8 +43,9 @@ module RubyLsp
43
43
  end
44
44
 
45
45
  class InitializationError < StandardError; end
46
- class IncompleteMessageError < StandardError; end
47
- class EmptyMessageError < StandardError; end
46
+ class MessageError < StandardError; end
47
+ class IncompleteMessageError < MessageError; end
48
+ class EmptyMessageError < MessageError; end
48
49
 
49
50
  extend T::Sig
50
51
 
@@ -115,7 +116,7 @@ module RubyLsp
115
116
  sig { params(server_addon_path: String).void }
116
117
  def register_server_addon(server_addon_path)
117
118
  send_notification("server_addon/register", server_addon_path: server_addon_path)
118
- rescue IncompleteMessageError
119
+ rescue MessageError
119
120
  log_message(
120
121
  "Ruby LSP Rails failed to register server addon #{server_addon_path}",
121
122
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -126,7 +127,7 @@ module RubyLsp
126
127
  sig { params(name: String).returns(T.nilable(T::Hash[Symbol, T.untyped])) }
127
128
  def model(name)
128
129
  make_request("model", name: name)
129
- rescue IncompleteMessageError
130
+ rescue MessageError
130
131
  log_message(
131
132
  "Ruby LSP Rails failed to get model information",
132
133
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -146,7 +147,7 @@ module RubyLsp
146
147
  model_name: model_name,
147
148
  association_name: association_name,
148
149
  )
149
- rescue IncompleteMessageError
150
+ rescue MessageError
150
151
  log_message(
151
152
  "Ruby LSP Rails failed to get association location",
152
153
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -157,7 +158,7 @@ module RubyLsp
157
158
  sig { params(name: String).returns(T.nilable(T::Hash[Symbol, T.untyped])) }
158
159
  def route_location(name)
159
160
  make_request("route_location", name: name)
160
- rescue IncompleteMessageError
161
+ rescue MessageError
161
162
  log_message(
162
163
  "Ruby LSP Rails failed to get route location",
163
164
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -168,7 +169,7 @@ module RubyLsp
168
169
  sig { params(controller: String, action: String).returns(T.nilable(T::Hash[Symbol, T.untyped])) }
169
170
  def route(controller:, action:)
170
171
  make_request("route_info", controller: controller, action: action)
171
- rescue IncompleteMessageError
172
+ rescue MessageError
172
173
  log_message(
173
174
  "Ruby LSP Rails failed to get route information",
174
175
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -191,7 +192,7 @@ module RubyLsp
191
192
  def pending_migrations_message
192
193
  response = make_request("pending_migrations_message")
193
194
  response[:pending_migrations_message] if response
194
- rescue IncompleteMessageError
195
+ rescue MessageError
195
196
  log_message(
196
197
  "Ruby LSP Rails failed when checking for pending migrations",
197
198
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -202,7 +203,7 @@ module RubyLsp
202
203
  sig { returns(T.nilable(T::Hash[Symbol, T.untyped])) }
203
204
  def run_migrations
204
205
  make_request("run_migrations")
205
- rescue IncompleteMessageError
206
+ rescue MessageError
206
207
  log_message(
207
208
  "Ruby LSP Rails failed to run migrations",
208
209
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -225,7 +226,7 @@ module RubyLsp
225
226
  request_name: request_name,
226
227
  **params,
227
228
  )
228
- rescue IncompleteMessageError
229
+ rescue MessageError
229
230
  nil
230
231
  end
231
232
 
@@ -233,7 +234,7 @@ module RubyLsp
233
234
  def trigger_reload
234
235
  log_message("Reloading Rails application")
235
236
  send_notification("reload")
236
- rescue IncompleteMessageError
237
+ rescue MessageError
237
238
  log_message(
238
239
  "Ruby LSP Rails failed to trigger reload",
239
240
  type: RubyLsp::Constant::MessageType::ERROR,
@@ -259,7 +259,8 @@ module RubyLsp
259
259
  end
260
260
 
261
261
  def pending_migrations_message
262
- return unless defined?(ActiveRecord)
262
+ # `check_all_pending!` is only available since Rails 7.1
263
+ return unless defined?(ActiveRecord) && ActiveRecord::Migration.respond_to?(:check_all_pending!)
263
264
 
264
265
  ActiveRecord::Migration.check_all_pending!
265
266
  nil
@@ -3,6 +3,6 @@
3
3
 
4
4
  module RubyLsp
5
5
  module Rails
6
- VERSION = "0.3.23"
6
+ VERSION = "0.3.25"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.23
4
+ version: 0.3.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-05 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-lsp
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubygems_version: 3.5.22
83
+ rubygems_version: 3.5.23
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: A Ruby LSP addon for Rails