ruby-lsp 0.23.11 → 0.23.13
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 +4 -4
- data/README.md +2 -2
- data/VERSION +1 -1
- data/exe/ruby-lsp-launcher +12 -11
- data/lib/rubocop/cop/ruby_lsp/use_language_server_aliases.rb +1 -1
- data/lib/rubocop/cop/ruby_lsp/use_register_with_handler_method.rb +3 -5
- data/lib/ruby_indexer/lib/ruby_indexer/configuration.rb +81 -115
- data/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +117 -166
- data/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb +9 -7
- data/lib/ruby_indexer/lib/ruby_indexer/entry.rb +88 -200
- data/lib/ruby_indexer/lib/ruby_indexer/index.rb +56 -192
- data/lib/ruby_indexer/lib/ruby_indexer/location.rb +4 -27
- data/lib/ruby_indexer/lib/ruby_indexer/prefix_tree.rb +14 -16
- data/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb +22 -45
- data/lib/ruby_indexer/lib/ruby_indexer/reference_finder.rb +42 -60
- data/lib/ruby_indexer/lib/ruby_indexer/uri.rb +9 -16
- data/lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb +5 -9
- data/lib/ruby_indexer/test/configuration_test.rb +42 -3
- data/lib/ruby_indexer/test/method_test.rb +28 -2
- data/lib/ruby_indexer/test/rbs_indexer_test.rb +1 -1
- data/lib/ruby_lsp/addon.rb +44 -71
- data/lib/ruby_lsp/base_server.rb +29 -32
- data/lib/ruby_lsp/client_capabilities.rb +10 -12
- data/lib/ruby_lsp/document.rb +34 -45
- data/lib/ruby_lsp/erb_document.rb +24 -36
- data/lib/ruby_lsp/global_state.rb +51 -56
- data/lib/ruby_lsp/internal.rb +2 -0
- data/lib/ruby_lsp/listeners/code_lens.rb +81 -88
- data/lib/ruby_lsp/listeners/completion.rb +36 -55
- data/lib/ruby_lsp/listeners/definition.rb +37 -51
- data/lib/ruby_lsp/listeners/document_highlight.rb +123 -150
- data/lib/ruby_lsp/listeners/document_link.rb +43 -62
- data/lib/ruby_lsp/listeners/document_symbol.rb +35 -49
- data/lib/ruby_lsp/listeners/folding_ranges.rb +32 -39
- data/lib/ruby_lsp/listeners/hover.rb +81 -100
- data/lib/ruby_lsp/listeners/inlay_hints.rb +4 -11
- data/lib/ruby_lsp/listeners/semantic_highlighting.rb +42 -51
- data/lib/ruby_lsp/listeners/signature_help.rb +6 -25
- data/lib/ruby_lsp/listeners/spec_style.rb +155 -0
- data/lib/ruby_lsp/listeners/test_discovery.rb +89 -0
- data/lib/ruby_lsp/listeners/test_style.rb +160 -88
- data/lib/ruby_lsp/node_context.rb +12 -39
- data/lib/ruby_lsp/rbs_document.rb +8 -6
- data/lib/ruby_lsp/requests/code_action_resolve.rb +10 -10
- data/lib/ruby_lsp/requests/code_actions.rb +14 -26
- data/lib/ruby_lsp/requests/code_lens.rb +6 -17
- data/lib/ruby_lsp/requests/completion.rb +7 -20
- data/lib/ruby_lsp/requests/completion_resolve.rb +5 -5
- data/lib/ruby_lsp/requests/definition.rb +8 -17
- data/lib/ruby_lsp/requests/diagnostics.rb +8 -11
- data/lib/ruby_lsp/requests/discover_tests.rb +18 -5
- data/lib/ruby_lsp/requests/document_highlight.rb +5 -15
- data/lib/ruby_lsp/requests/document_link.rb +6 -17
- data/lib/ruby_lsp/requests/document_symbol.rb +5 -8
- data/lib/ruby_lsp/requests/folding_ranges.rb +7 -15
- data/lib/ruby_lsp/requests/formatting.rb +6 -9
- data/lib/ruby_lsp/requests/go_to_relevant_file.rb +87 -0
- data/lib/ruby_lsp/requests/hover.rb +8 -18
- data/lib/ruby_lsp/requests/inlay_hints.rb +6 -17
- data/lib/ruby_lsp/requests/on_type_formatting.rb +28 -38
- data/lib/ruby_lsp/requests/prepare_rename.rb +4 -9
- data/lib/ruby_lsp/requests/prepare_type_hierarchy.rb +4 -13
- data/lib/ruby_lsp/requests/range_formatting.rb +5 -6
- data/lib/ruby_lsp/requests/references.rb +6 -36
- data/lib/ruby_lsp/requests/rename.rb +11 -37
- data/lib/ruby_lsp/requests/request.rb +7 -19
- data/lib/ruby_lsp/requests/selection_ranges.rb +5 -5
- data/lib/ruby_lsp/requests/semantic_highlighting.rb +12 -31
- data/lib/ruby_lsp/requests/show_syntax_tree.rb +5 -6
- data/lib/ruby_lsp/requests/signature_help.rb +8 -26
- data/lib/ruby_lsp/requests/support/annotation.rb +4 -10
- data/lib/ruby_lsp/requests/support/common.rb +13 -50
- data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +27 -35
- data/lib/ruby_lsp/requests/support/rubocop_formatter.rb +9 -12
- data/lib/ruby_lsp/requests/support/rubocop_runner.rb +22 -34
- data/lib/ruby_lsp/requests/support/selection_range.rb +1 -3
- data/lib/ruby_lsp/requests/support/sorbet.rb +29 -38
- data/lib/ruby_lsp/requests/support/source_uri.rb +16 -30
- data/lib/ruby_lsp/requests/support/syntax_tree_formatter.rb +12 -19
- data/lib/ruby_lsp/requests/support/test_item.rb +10 -14
- data/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb +5 -6
- data/lib/ruby_lsp/requests/workspace_symbol.rb +4 -4
- data/lib/ruby_lsp/response_builders/collection_response_builder.rb +5 -5
- data/lib/ruby_lsp/response_builders/document_symbol.rb +10 -16
- data/lib/ruby_lsp/response_builders/hover.rb +10 -13
- data/lib/ruby_lsp/response_builders/response_builder.rb +1 -1
- data/lib/ruby_lsp/response_builders/semantic_highlighting.rb +59 -87
- data/lib/ruby_lsp/response_builders/signature_help.rb +5 -6
- data/lib/ruby_lsp/response_builders/test_collection.rb +6 -10
- data/lib/ruby_lsp/ruby_document.rb +22 -60
- data/lib/ruby_lsp/ruby_lsp_reporter_plugin.rb +109 -0
- data/lib/ruby_lsp/scope.rb +7 -11
- data/lib/ruby_lsp/server.rb +133 -74
- data/lib/ruby_lsp/setup_bundler.rb +58 -57
- data/lib/ruby_lsp/static_docs.rb +4 -7
- data/lib/ruby_lsp/store.rb +21 -40
- data/lib/ruby_lsp/test_helper.rb +3 -12
- data/lib/ruby_lsp/test_reporter.rb +207 -0
- data/lib/ruby_lsp/test_unit_test_runner.rb +98 -0
- data/lib/ruby_lsp/type_inferrer.rb +9 -13
- data/lib/ruby_lsp/utils.rb +37 -81
- metadata +9 -3
@@ -0,0 +1,98 @@
|
|
1
|
+
# typed: true
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
begin
|
5
|
+
require "test/unit"
|
6
|
+
require "test/unit/ui/testrunner"
|
7
|
+
rescue LoadError
|
8
|
+
return
|
9
|
+
end
|
10
|
+
|
11
|
+
require_relative "test_reporter"
|
12
|
+
require "ruby_indexer/lib/ruby_indexer/uri"
|
13
|
+
|
14
|
+
module RubyLsp
|
15
|
+
class TestRunner < ::Test::Unit::UI::TestRunner
|
16
|
+
private
|
17
|
+
|
18
|
+
#: (::Test::Unit::TestCase test) -> void
|
19
|
+
def test_started(test)
|
20
|
+
current_test = test
|
21
|
+
@current_uri = uri_for_test(current_test)
|
22
|
+
return unless @current_uri
|
23
|
+
|
24
|
+
@current_test_id = "#{current_test.class.name}##{current_test.method_name}"
|
25
|
+
TestReporter.start_test(
|
26
|
+
id: @current_test_id,
|
27
|
+
uri: @current_uri,
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
#: (::Test::Unit::TestCase test) -> void
|
32
|
+
def test_finished(test)
|
33
|
+
if test.passed?
|
34
|
+
TestReporter.record_pass(
|
35
|
+
id: @current_test_id,
|
36
|
+
uri: @current_uri,
|
37
|
+
)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
#: (::Test::Unit::Failure | ::Test::Unit::Error | ::Test::Unit::Pending result) -> void
|
42
|
+
def result_fault(result)
|
43
|
+
case result
|
44
|
+
when ::Test::Unit::Failure
|
45
|
+
record_failure(result)
|
46
|
+
when ::Test::Unit::Error
|
47
|
+
record_error(result)
|
48
|
+
when ::Test::Unit::Pending
|
49
|
+
record_skip(result)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
#: (::Test::Unit::Failure failure) -> void
|
54
|
+
def record_failure(failure)
|
55
|
+
TestReporter.record_fail(
|
56
|
+
id: @current_test_id,
|
57
|
+
message: failure.message,
|
58
|
+
uri: @current_uri,
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
#: (::Test::Unit::Error error) -> void
|
63
|
+
def record_error(error)
|
64
|
+
TestReporter.record_error(
|
65
|
+
id: @current_test_id,
|
66
|
+
message: error.message,
|
67
|
+
uri: @current_uri,
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
#: (::Test::Unit::Pending pending) -> void
|
72
|
+
def record_skip(pending)
|
73
|
+
TestReporter.record_skip(id: @current_test_id, uri: @current_uri)
|
74
|
+
end
|
75
|
+
|
76
|
+
#: (::Test::Unit::TestCase test) -> URI::Generic?
|
77
|
+
def uri_for_test(test)
|
78
|
+
location = test.method(test.method_name).source_location
|
79
|
+
return unless location # TODO: when might this be nil?
|
80
|
+
|
81
|
+
file, _line = location
|
82
|
+
return if file.start_with?("(eval at ") # test is dynamically defined (TODO: better way to check?)
|
83
|
+
|
84
|
+
absolute_path = File.expand_path(file, Dir.pwd)
|
85
|
+
URI::Generic.from_path(path: absolute_path)
|
86
|
+
end
|
87
|
+
|
88
|
+
#: -> void
|
89
|
+
def attach_to_mediator
|
90
|
+
@mediator.add_listener(Test::Unit::TestResult::FAULT, &method(:result_fault))
|
91
|
+
@mediator.add_listener(Test::Unit::TestCase::STARTED_OBJECT, &method(:test_started))
|
92
|
+
@mediator.add_listener(Test::Unit::TestCase::FINISHED_OBJECT, &method(:test_finished))
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
Test::Unit::AutoRunner.register_runner(:ruby_lsp) { |_auto_runner| RubyLsp::TestRunner }
|
98
|
+
Test::Unit::AutoRunner.default_runner = :ruby_lsp
|
@@ -5,14 +5,12 @@ module RubyLsp
|
|
5
5
|
# A minimalistic type checker to try to resolve types that can be inferred without requiring a type system or
|
6
6
|
# annotations
|
7
7
|
class TypeInferrer
|
8
|
-
|
9
|
-
|
10
|
-
sig { params(index: RubyIndexer::Index).void }
|
8
|
+
#: (RubyIndexer::Index index) -> void
|
11
9
|
def initialize(index)
|
12
10
|
@index = index
|
13
11
|
end
|
14
12
|
|
15
|
-
|
13
|
+
#: (NodeContext node_context) -> Type?
|
16
14
|
def infer_receiver_type(node_context)
|
17
15
|
node = node_context.node
|
18
16
|
|
@@ -31,7 +29,7 @@ module RubyLsp
|
|
31
29
|
|
32
30
|
private
|
33
31
|
|
34
|
-
|
32
|
+
#: (Prism::CallNode node, NodeContext node_context) -> Type?
|
35
33
|
def infer_receiver_for_call_node(node, node_context)
|
36
34
|
receiver = node.receiver
|
37
35
|
|
@@ -114,7 +112,7 @@ module RubyLsp
|
|
114
112
|
end
|
115
113
|
end
|
116
114
|
|
117
|
-
|
115
|
+
#: (String raw_receiver, Array[String] nesting) -> GuessedType?
|
118
116
|
def guess_type(raw_receiver, nesting)
|
119
117
|
guessed_name = raw_receiver
|
120
118
|
.delete_prefix("@")
|
@@ -130,7 +128,7 @@ module RubyLsp
|
|
130
128
|
GuessedType.new(name)
|
131
129
|
end
|
132
130
|
|
133
|
-
|
131
|
+
#: (NodeContext node_context) -> Type
|
134
132
|
def self_receiver_handling(node_context)
|
135
133
|
nesting = node_context.nesting
|
136
134
|
# If we're at the top level, then the invocation is happening on `<main>`, which is a special singleton that
|
@@ -147,7 +145,7 @@ module RubyLsp
|
|
147
145
|
Type.new("#{parts.join("::")}::<Class:#{parts.last}>")
|
148
146
|
end
|
149
147
|
|
150
|
-
|
148
|
+
#: (NodeContext node_context) -> Type?
|
151
149
|
def infer_receiver_for_class_variables(node_context)
|
152
150
|
nesting_parts = node_context.nesting.dup
|
153
151
|
|
@@ -168,18 +166,16 @@ module RubyLsp
|
|
168
166
|
|
169
167
|
# A known type
|
170
168
|
class Type
|
171
|
-
|
172
|
-
|
173
|
-
sig { returns(String) }
|
169
|
+
#: String
|
174
170
|
attr_reader :name
|
175
171
|
|
176
|
-
|
172
|
+
#: (String name) -> void
|
177
173
|
def initialize(name)
|
178
174
|
@name = name
|
179
175
|
end
|
180
176
|
|
181
177
|
# Returns the attached version of this type by removing the `<Class:...>` part from its name
|
182
|
-
|
178
|
+
#: -> Type
|
183
179
|
def attached
|
184
180
|
Type.new(T.must(@name.split("::")[..-2]).join("::"))
|
185
181
|
end
|
data/lib/ruby_lsp/utils.rb
CHANGED
@@ -9,22 +9,16 @@ module RubyLsp
|
|
9
9
|
# rubocop:enable RubyLsp/UseLanguageServerAliases
|
10
10
|
|
11
11
|
# Used to indicate that a request shouldn't return a response
|
12
|
-
BUNDLE_PATH =
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
Bundler.with_original_env { Bundler.default_gemfile.basename.to_s }
|
23
|
-
rescue Bundler::GemfileNotFound
|
24
|
-
"Gemfile"
|
25
|
-
end,
|
26
|
-
String,
|
27
|
-
)
|
12
|
+
BUNDLE_PATH = begin
|
13
|
+
Bundler.bundle_path.to_s
|
14
|
+
rescue Bundler::GemfileNotFound
|
15
|
+
nil
|
16
|
+
end #: String?
|
17
|
+
GEMFILE_NAME = begin
|
18
|
+
Bundler.with_original_env { Bundler.default_gemfile.basename.to_s }
|
19
|
+
rescue Bundler::GemfileNotFound
|
20
|
+
"Gemfile"
|
21
|
+
end #: String
|
28
22
|
GUESSED_TYPES_URL = "https://shopify.github.io/ruby-lsp/#guessed-types"
|
29
23
|
|
30
24
|
# Request delegation for embedded languages is not yet standardized into the language server specification. Here we
|
@@ -44,15 +38,15 @@ module RubyLsp
|
|
44
38
|
extend T::Sig
|
45
39
|
extend T::Helpers
|
46
40
|
|
47
|
-
|
41
|
+
#: String
|
48
42
|
attr_reader :method
|
49
43
|
|
50
|
-
|
44
|
+
#: Object
|
51
45
|
attr_reader :params
|
52
46
|
|
53
47
|
abstract!
|
54
48
|
|
55
|
-
|
49
|
+
#: (method: String, params: Object) -> void
|
56
50
|
def initialize(method:, params:)
|
57
51
|
@method = method
|
58
52
|
@params = params
|
@@ -64,9 +58,7 @@ module RubyLsp
|
|
64
58
|
|
65
59
|
class Notification < Message
|
66
60
|
class << self
|
67
|
-
|
68
|
-
|
69
|
-
sig { params(message: String, type: Integer).returns(Notification) }
|
61
|
+
#: (String message, ?type: Integer) -> Notification
|
70
62
|
def window_show_message(message, type: Constant::MessageType::INFO)
|
71
63
|
new(
|
72
64
|
method: "window/showMessage",
|
@@ -74,7 +66,7 @@ module RubyLsp
|
|
74
66
|
)
|
75
67
|
end
|
76
68
|
|
77
|
-
|
69
|
+
#: (String message, ?type: Integer) -> Notification
|
78
70
|
def window_log_message(message, type: Constant::MessageType::LOG)
|
79
71
|
new(
|
80
72
|
method: "window/logMessage",
|
@@ -82,7 +74,7 @@ module RubyLsp
|
|
82
74
|
)
|
83
75
|
end
|
84
76
|
|
85
|
-
|
77
|
+
#: (Hash[Symbol, untyped] data) -> Notification
|
86
78
|
def telemetry(data)
|
87
79
|
new(
|
88
80
|
method: "telemetry/event",
|
@@ -90,14 +82,7 @@ module RubyLsp
|
|
90
82
|
)
|
91
83
|
end
|
92
84
|
|
93
|
-
|
94
|
-
params(
|
95
|
-
id: String,
|
96
|
-
title: String,
|
97
|
-
percentage: T.nilable(Integer),
|
98
|
-
message: T.nilable(String),
|
99
|
-
).returns(Notification)
|
100
|
-
end
|
85
|
+
#: (String id, String title, ?percentage: Integer?, ?message: String?) -> Notification
|
101
86
|
def progress_begin(id, title, percentage: nil, message: nil)
|
102
87
|
new(
|
103
88
|
method: "$/progress",
|
@@ -113,13 +98,7 @@ module RubyLsp
|
|
113
98
|
)
|
114
99
|
end
|
115
100
|
|
116
|
-
|
117
|
-
params(
|
118
|
-
id: String,
|
119
|
-
percentage: T.nilable(Integer),
|
120
|
-
message: T.nilable(String),
|
121
|
-
).returns(Notification)
|
122
|
-
end
|
101
|
+
#: (String id, ?percentage: Integer?, ?message: String?) -> Notification
|
123
102
|
def progress_report(id, percentage: nil, message: nil)
|
124
103
|
new(
|
125
104
|
method: "$/progress",
|
@@ -134,7 +113,7 @@ module RubyLsp
|
|
134
113
|
)
|
135
114
|
end
|
136
115
|
|
137
|
-
|
116
|
+
#: (String id) -> Notification
|
138
117
|
def progress_end(id)
|
139
118
|
Notification.new(
|
140
119
|
method: "$/progress",
|
@@ -145,13 +124,7 @@ module RubyLsp
|
|
145
124
|
)
|
146
125
|
end
|
147
126
|
|
148
|
-
|
149
|
-
params(
|
150
|
-
uri: String,
|
151
|
-
diagnostics: T::Array[Interface::Diagnostic],
|
152
|
-
version: T.nilable(Integer),
|
153
|
-
).returns(Notification)
|
154
|
-
end
|
127
|
+
#: (String uri, Array[Interface::Diagnostic] diagnostics, ?version: Integer?) -> Notification
|
155
128
|
def publish_diagnostics(uri, diagnostics, version: nil)
|
156
129
|
new(
|
157
130
|
method: "textDocument/publishDiagnostics",
|
@@ -160,9 +133,8 @@ module RubyLsp
|
|
160
133
|
end
|
161
134
|
end
|
162
135
|
|
163
|
-
|
164
|
-
|
165
|
-
sig { override.returns(T::Hash[Symbol, T.untyped]) }
|
136
|
+
# @override
|
137
|
+
#: -> Hash[Symbol, untyped]
|
166
138
|
def to_hash
|
167
139
|
hash = { method: @method }
|
168
140
|
hash[:params] = T.unsafe(@params).to_hash if @params
|
@@ -171,19 +143,8 @@ module RubyLsp
|
|
171
143
|
end
|
172
144
|
|
173
145
|
class Request < Message
|
174
|
-
extend T::Sig
|
175
|
-
|
176
146
|
class << self
|
177
|
-
|
178
|
-
|
179
|
-
sig do
|
180
|
-
params(
|
181
|
-
id: Integer,
|
182
|
-
pattern: T.any(Interface::RelativePattern, String),
|
183
|
-
kind: Integer,
|
184
|
-
registration_id: T.nilable(String),
|
185
|
-
).returns(Request)
|
186
|
-
end
|
147
|
+
#: (Integer id, (Interface::RelativePattern | String) pattern, ?kind: Integer, ?registration_id: String?) -> Request
|
187
148
|
def register_watched_files(
|
188
149
|
id,
|
189
150
|
pattern,
|
@@ -210,13 +171,14 @@ module RubyLsp
|
|
210
171
|
end
|
211
172
|
end
|
212
173
|
|
213
|
-
|
174
|
+
#: (id: (Integer | String), method: String, params: Object) -> void
|
214
175
|
def initialize(id:, method:, params:)
|
215
176
|
@id = id
|
216
177
|
super(method: method, params: params)
|
217
178
|
end
|
218
179
|
|
219
|
-
|
180
|
+
# @override
|
181
|
+
#: -> Hash[Symbol, untyped]
|
220
182
|
def to_hash
|
221
183
|
hash = { id: @id, method: @method }
|
222
184
|
hash[:params] = T.unsafe(@params).to_hash if @params
|
@@ -225,15 +187,13 @@ module RubyLsp
|
|
225
187
|
end
|
226
188
|
|
227
189
|
class Error
|
228
|
-
|
229
|
-
|
230
|
-
sig { returns(String) }
|
190
|
+
#: String
|
231
191
|
attr_reader :message
|
232
192
|
|
233
|
-
|
193
|
+
#: Integer
|
234
194
|
attr_reader :code
|
235
195
|
|
236
|
-
|
196
|
+
#: (id: Integer, code: Integer, message: String, ?data: Hash[Symbol, untyped]?) -> void
|
237
197
|
def initialize(id:, code:, message:, data: nil)
|
238
198
|
@id = id
|
239
199
|
@code = code
|
@@ -241,7 +201,7 @@ module RubyLsp
|
|
241
201
|
@data = data
|
242
202
|
end
|
243
203
|
|
244
|
-
|
204
|
+
#: -> Hash[Symbol, untyped]
|
245
205
|
def to_hash
|
246
206
|
{
|
247
207
|
id: @id,
|
@@ -256,21 +216,19 @@ module RubyLsp
|
|
256
216
|
|
257
217
|
# The final result of running a request before its IO is finalized
|
258
218
|
class Result
|
259
|
-
|
260
|
-
|
261
|
-
sig { returns(T.untyped) }
|
219
|
+
#: untyped
|
262
220
|
attr_reader :response
|
263
221
|
|
264
|
-
|
222
|
+
#: Integer
|
265
223
|
attr_reader :id
|
266
224
|
|
267
|
-
|
225
|
+
#: (id: Integer, response: untyped) -> void
|
268
226
|
def initialize(id:, response:)
|
269
227
|
@id = id
|
270
228
|
@response = response
|
271
229
|
end
|
272
230
|
|
273
|
-
|
231
|
+
#: -> Hash[Symbol, untyped]
|
274
232
|
def to_hash
|
275
233
|
{ id: @id, result: @response }
|
276
234
|
end
|
@@ -278,17 +236,15 @@ module RubyLsp
|
|
278
236
|
|
279
237
|
# A request configuration, to turn on/off features
|
280
238
|
class RequestConfig
|
281
|
-
|
282
|
-
|
283
|
-
sig { returns(T::Hash[Symbol, T::Boolean]) }
|
239
|
+
#: Hash[Symbol, bool]
|
284
240
|
attr_accessor :configuration
|
285
241
|
|
286
|
-
|
242
|
+
#: (Hash[Symbol, bool] configuration) -> void
|
287
243
|
def initialize(configuration)
|
288
244
|
@configuration = configuration
|
289
245
|
end
|
290
246
|
|
291
|
-
|
247
|
+
#: (Symbol feature) -> bool?
|
292
248
|
def enabled?(feature)
|
293
249
|
@configuration[:enableAll] || @configuration[feature]
|
294
250
|
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.
|
4
|
+
version: 0.23.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-28 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: language_server-protocol
|
@@ -140,6 +140,8 @@ files:
|
|
140
140
|
- lib/ruby_lsp/listeners/inlay_hints.rb
|
141
141
|
- lib/ruby_lsp/listeners/semantic_highlighting.rb
|
142
142
|
- lib/ruby_lsp/listeners/signature_help.rb
|
143
|
+
- lib/ruby_lsp/listeners/spec_style.rb
|
144
|
+
- lib/ruby_lsp/listeners/test_discovery.rb
|
143
145
|
- lib/ruby_lsp/listeners/test_style.rb
|
144
146
|
- lib/ruby_lsp/load_sorbet.rb
|
145
147
|
- lib/ruby_lsp/node_context.rb
|
@@ -157,6 +159,7 @@ files:
|
|
157
159
|
- lib/ruby_lsp/requests/document_symbol.rb
|
158
160
|
- lib/ruby_lsp/requests/folding_ranges.rb
|
159
161
|
- lib/ruby_lsp/requests/formatting.rb
|
162
|
+
- lib/ruby_lsp/requests/go_to_relevant_file.rb
|
160
163
|
- lib/ruby_lsp/requests/hover.rb
|
161
164
|
- lib/ruby_lsp/requests/inlay_hints.rb
|
162
165
|
- lib/ruby_lsp/requests/on_type_formatting.rb
|
@@ -191,6 +194,7 @@ files:
|
|
191
194
|
- lib/ruby_lsp/response_builders/signature_help.rb
|
192
195
|
- lib/ruby_lsp/response_builders/test_collection.rb
|
193
196
|
- lib/ruby_lsp/ruby_document.rb
|
197
|
+
- lib/ruby_lsp/ruby_lsp_reporter_plugin.rb
|
194
198
|
- lib/ruby_lsp/scope.rb
|
195
199
|
- lib/ruby_lsp/scripts/compose_bundle.rb
|
196
200
|
- lib/ruby_lsp/scripts/compose_bundle_windows.rb
|
@@ -199,6 +203,8 @@ files:
|
|
199
203
|
- lib/ruby_lsp/static_docs.rb
|
200
204
|
- lib/ruby_lsp/store.rb
|
201
205
|
- lib/ruby_lsp/test_helper.rb
|
206
|
+
- lib/ruby_lsp/test_reporter.rb
|
207
|
+
- lib/ruby_lsp/test_unit_test_runner.rb
|
202
208
|
- lib/ruby_lsp/type_inferrer.rb
|
203
209
|
- lib/ruby_lsp/utils.rb
|
204
210
|
- static_docs/yield.md
|
@@ -222,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
228
|
- !ruby/object:Gem::Version
|
223
229
|
version: '0'
|
224
230
|
requirements: []
|
225
|
-
rubygems_version: 3.6.
|
231
|
+
rubygems_version: 3.6.6
|
226
232
|
specification_version: 4
|
227
233
|
summary: An opinionated language server for Ruby
|
228
234
|
test_files: []
|