ruby-lsp 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/exe/ruby-lsp +3 -2
- data/lib/ruby_lsp/executor.rb +3 -0
- data/lib/ruby_lsp/extension.rb +9 -0
- data/lib/ruby_lsp/requests/document_symbol.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c2f16b0f0e93ade0e4465fcf71148ac156f6d65b1354f07af2df4007c600c15
|
4
|
+
data.tar.gz: 7c6f4668f461315039e37f04354dddadb1678dd89ff9c249a268897992dfa4c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 184683630988346ae617e3df3d6d04c66b822d6d9734f595a41caa3603b38046e5ee5a7a4361abede0f3b8d1584371730be9af905d006fa881d4b718f3381947
|
7
|
+
data.tar.gz: 7c10ef841c059110b1d5bc38cde57de243140c37d7095ab8c7ce16d28e4c520c402f2bfcf604f7002a7e06d7db031b8ab9e52ce28bf3c50be0dc2671d5728170
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.3
|
data/exe/ruby-lsp
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
require "optparse"
|
5
5
|
|
6
|
+
original_args = ARGV.dup
|
6
7
|
options = {}
|
7
8
|
parser = OptionParser.new do |opts|
|
8
9
|
opts.banner = "Usage: ruby-lsp [options]"
|
@@ -33,7 +34,7 @@ parser = OptionParser.new do |opts|
|
|
33
34
|
end
|
34
35
|
|
35
36
|
begin
|
36
|
-
parser.parse
|
37
|
+
parser.parse!
|
37
38
|
rescue OptionParser::InvalidOption => e
|
38
39
|
warn(e)
|
39
40
|
warn("")
|
@@ -56,7 +57,7 @@ if ENV["BUNDLE_GEMFILE"].nil?
|
|
56
57
|
|
57
58
|
env = { "BUNDLE_GEMFILE" => bundle_gemfile }
|
58
59
|
env["BUNDLE_PATH"] = bundle_path if bundle_path
|
59
|
-
exit exec(env, "bundle exec ruby-lsp #{
|
60
|
+
exit exec(env, "bundle exec ruby-lsp #{original_args.join(" ")}")
|
60
61
|
end
|
61
62
|
|
62
63
|
require "sorbet-runtime"
|
data/lib/ruby_lsp/executor.rb
CHANGED
@@ -104,6 +104,7 @@ module RubyLsp
|
|
104
104
|
emitter.visit(document.tree) if document.parsed?
|
105
105
|
|
106
106
|
code_lens.merge_external_listeners_responses!
|
107
|
+
document_symbol.merge_external_listeners_responses!
|
107
108
|
|
108
109
|
# Store all responses retrieve in this round of visits in the cache and then return the response for the request
|
109
110
|
# we actually received
|
@@ -177,6 +178,8 @@ module RubyLsp
|
|
177
178
|
workspace_symbol(request.dig(:params, :query))
|
178
179
|
when "rubyLsp/textDocument/showSyntaxTree"
|
179
180
|
show_syntax_tree(uri, request.dig(:params, :range))
|
181
|
+
else
|
182
|
+
VOID
|
180
183
|
end
|
181
184
|
end
|
182
185
|
|
data/lib/ruby_lsp/extension.rb
CHANGED
@@ -124,5 +124,14 @@ module RubyLsp
|
|
124
124
|
).returns(T.nilable(Listener[T.nilable(Interface::Hover)]))
|
125
125
|
end
|
126
126
|
def create_hover_listener(emitter, message_queue); end
|
127
|
+
|
128
|
+
# Creates a new DocumentSymbol listener. This method is invoked on every DocumentSymbol request
|
129
|
+
sig do
|
130
|
+
overridable.params(
|
131
|
+
emitter: EventEmitter,
|
132
|
+
message_queue: Thread::Queue,
|
133
|
+
).returns(T.nilable(Listener[T.nilable(Interface::DocumentSymbol)]))
|
134
|
+
end
|
135
|
+
def create_document_symbol_listener(emitter, message_queue); end
|
127
136
|
end
|
128
137
|
end
|
@@ -60,6 +60,10 @@ module RubyLsp
|
|
60
60
|
T::Array[T.any(SymbolHierarchyRoot, Interface::DocumentSymbol)],
|
61
61
|
)
|
62
62
|
|
63
|
+
@external_listeners.concat(
|
64
|
+
Extension.extensions.filter_map { |ext| ext.create_document_symbol_listener(emitter, message_queue) },
|
65
|
+
)
|
66
|
+
|
63
67
|
emitter.register(
|
64
68
|
self,
|
65
69
|
:on_class,
|
@@ -75,6 +79,13 @@ module RubyLsp
|
|
75
79
|
)
|
76
80
|
end
|
77
81
|
|
82
|
+
# Merges responses from other listeners
|
83
|
+
sig { override.params(other: Listener[ResponseType]).returns(T.self_type) }
|
84
|
+
def merge_response!(other)
|
85
|
+
@response.concat(other.response)
|
86
|
+
self
|
87
|
+
end
|
88
|
+
|
78
89
|
sig { params(node: SyntaxTree::ClassDeclaration).void }
|
79
90
|
def on_class(node)
|
80
91
|
@stack << create_document_symbol(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lsp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: language_server-protocol
|