ruby-lsp-rails 0.3.19 → 0.3.21
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feb1936ab1a1b20409425b3d644ab0e3c158b6f21a6bdf024d73013ccac28120
|
4
|
+
data.tar.gz: f32daf2f444a0ca0fa2a55b0d2bdef2d67abfcf40b4bae5cd351eede9b50dc11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72082ba3519fec8b3453201b9ffa9a270d745bdb4abff0e70edce58ad82024aae836a604bcdbdcec73f54faaae8b28e5a646ffec4bd0910c88099d425f3a6606
|
7
|
+
data.tar.gz: 4c53919cae2b20d3dbd6402721ebe9470ba89ab4a2db24cbc61f04484d8b19c23c7c99017042ac09fff55e4f3cf34c2830890a270245b89011a0691ba6ab11f1
|
@@ -141,7 +141,7 @@ module RubyLsp
|
|
141
141
|
|
142
142
|
arg_receiver = argument.receiver
|
143
143
|
|
144
|
-
name = arg_receiver
|
144
|
+
name = constant_name(arg_receiver) if arg_receiver.is_a?(Prism::ConstantReadNode) ||
|
145
145
|
arg_receiver.is_a?(Prism::ConstantPathNode)
|
146
146
|
next unless name
|
147
147
|
|
@@ -201,8 +201,8 @@ module RubyLsp
|
|
201
201
|
arguments.each do |argument|
|
202
202
|
case argument
|
203
203
|
when Prism::ConstantReadNode, Prism::ConstantPathNode
|
204
|
-
name = argument
|
205
|
-
next
|
204
|
+
name = constant_name(argument)
|
205
|
+
next unless name
|
206
206
|
|
207
207
|
append_document_symbol(
|
208
208
|
name: "#{message} #{name}",
|
@@ -15,8 +15,8 @@ module RubyLsp
|
|
15
15
|
@stdout.write("Content-Length: #{json_message.length}\r\n\r\n#{json_message}")
|
16
16
|
end
|
17
17
|
|
18
|
-
# Log a
|
19
|
-
def
|
18
|
+
# Log a message to the editor's output panel
|
19
|
+
def log_message(message)
|
20
20
|
$stderr.puts(message)
|
21
21
|
end
|
22
22
|
end
|
@@ -119,12 +119,17 @@ module RubyLsp
|
|
119
119
|
require params[:server_addon_path]
|
120
120
|
ServerAddon.finalize_registrations!(@stdout)
|
121
121
|
when "server_addon/delegate"
|
122
|
-
server_addon_name = params
|
123
|
-
request_name = params
|
124
|
-
ServerAddon.delegate(server_addon_name, request_name, params)
|
122
|
+
server_addon_name = params[:server_addon_name]
|
123
|
+
request_name = params[:request_name]
|
124
|
+
ServerAddon.delegate(server_addon_name, request_name, params.except(:request_name, :server_addon_name))
|
125
125
|
end
|
126
|
+
request_name = request
|
127
|
+
request_name = "#{params[:server_addon_name]}##{params[:request_name]}" if request == "server_addon/delegate"
|
128
|
+
# Since this is a common problem, we show a specific error message to the user, instead of the full stack trace.
|
129
|
+
rescue ActiveRecord::ConnectionNotEstablished
|
130
|
+
log_message("Request #{request_name} failed because database connection was not established.")
|
126
131
|
rescue => e
|
127
|
-
|
132
|
+
log_message("Request #{request_name} failed:\n" + e.full_message(highlight: false))
|
128
133
|
end
|
129
134
|
|
130
135
|
private
|
@@ -141,8 +146,10 @@ module RubyLsp
|
|
141
146
|
::Rails.application.routes.routes.find { |route| route.requirements == requirements }
|
142
147
|
end
|
143
148
|
|
144
|
-
|
145
|
-
|
149
|
+
source_location = route&.respond_to?(:source_location) && route.source_location
|
150
|
+
|
151
|
+
if source_location
|
152
|
+
file, _, line = source_location.rpartition(":")
|
146
153
|
body = {
|
147
154
|
source_location: [::Rails.root.join(file).to_s, line],
|
148
155
|
verb: route.verb,
|
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.
|
4
|
+
version: 0.3.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-23 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.
|
83
|
+
rubygems_version: 3.5.22
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: A Ruby LSP addon for Rails
|