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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edcd6c49e7546a82b2e64a023c04be808dac40695a2e5667f915f17b4f9fc08a
4
- data.tar.gz: d8751bfd61a98e1a42d596b03d0dca55bd3441d3ec206b7ab36c6bf38f3afdcd
3
+ metadata.gz: 0c2f16b0f0e93ade0e4465fcf71148ac156f6d65b1354f07af2df4007c600c15
4
+ data.tar.gz: 7c6f4668f461315039e37f04354dddadb1678dd89ff9c249a268897992dfa4c0
5
5
  SHA512:
6
- metadata.gz: d71efe1d5848a42076452ddc0b714926bd2fed03730ffc5d509df1dbed67524484af607cb473fb03c9bee2867eb64654afa64ca8c349a39cde09e321cb6550b8
7
- data.tar.gz: a87eedc485b3280982c25d45c455d1a5420582ad30739cdb4268068b766b707104f37d9eba82875494f5e5eb5bb0bb6592ad2e42bfcb65cf20f65a8636d57210
6
+ metadata.gz: 184683630988346ae617e3df3d6d04c66b822d6d9734f595a41caa3603b38046e5ee5a7a4361abede0f3b8d1584371730be9af905d006fa881d4b718f3381947
7
+ data.tar.gz: 7c10ef841c059110b1d5bc38cde57de243140c37d7095ab8c7ce16d28e4c520c402f2bfcf604f7002a7e06d7db031b8ab9e52ce28bf3c50be0dc2671d5728170
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.2
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 #{ARGV.join(" ")}")
60
+ exit exec(env, "bundle exec ruby-lsp #{original_args.join(" ")}")
60
61
  end
61
62
 
62
63
  require "sorbet-runtime"
@@ -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
 
@@ -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.2
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-08-29 00:00:00.000000000 Z
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