ruby-lsp 0.12.1 → 0.12.2

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: 2774623b2161a416bfb07769e8eb5ccf3d40177f98edf9e4d4ed4c7e3f7fd47b
4
- data.tar.gz: 23626aa84fdaf85571c7d039d670f9131409ccb7a8cd2c61d4889ffd08ecb8de
3
+ metadata.gz: 3f60569fbb67f1c78fcffed58dbf540cb4e68fe10200841e54cd8a68859cf0de
4
+ data.tar.gz: 07c4419c763e590e1fbed7fe14a2660c1bf6ddbd92ca791948a8c2235208f6e9
5
5
  SHA512:
6
- metadata.gz: ffd099ba6d95ce10cd3fd2c3fb1e431d5481e0e8bad77c062fdd9b2f9fce534f9c58319672e508d17ca089e10ba9fdf398479dd9dfac3adbc347912815800cdd
7
- data.tar.gz: fb0f4c3111718c5f792266459e2694787ea7939b63c819707bba764395dc6cc3bf1d925517a1fa412b362fbd0b3222e8460723df4f2c3a4272ac73dc62eb872a
6
+ metadata.gz: 5284be197a27351a845cbcfc1735a0e9546472d60f9600ffd4ee55ba3ab0998438110c1ec59f684e0cf2fbaa7ff99f89878919ae3954022372e50116182c59dd
7
+ data.tar.gz: f706c17b0cd47c1001bffb42f6c9a1c43efbd390e548ffe7b51fb3c58bdb433c868a7f907a3aa32175d7742ccbb3c1c29606a0c7c979246bfe887500e6531676
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.1
1
+ 0.12.2
@@ -198,7 +198,11 @@ module RubyIndexer
198
198
  excluded.each do |dependency|
199
199
  next unless dependency.runtime?
200
200
 
201
- dependency.to_spec.dependencies.each do |transitive_dependency|
201
+ # If the dependency is prerelease, to_spec may return `nil`
202
+ spec = dependency.to_spec
203
+ next unless spec
204
+
205
+ spec.dependencies.each do |transitive_dependency|
202
206
  # If the transitive dependency is included in other groups, skip it
203
207
  next if others.any? { |d| d.name == transitive_dependency.name }
204
208
 
@@ -73,6 +73,8 @@ module RubyLsp
73
73
  :on_module_node_leave,
74
74
  :on_instance_variable_write_node_enter,
75
75
  :on_class_variable_write_node_enter,
76
+ :on_singleton_class_node_enter,
77
+ :on_singleton_class_node_leave,
76
78
  )
77
79
  end
78
80
 
@@ -103,6 +105,23 @@ module RubyLsp
103
105
  @stack.pop
104
106
  end
105
107
 
108
+ sig { params(node: Prism::SingletonClassNode).void }
109
+ def on_singleton_class_node_enter(node)
110
+ expression = node.expression
111
+
112
+ @stack << create_document_symbol(
113
+ name: "<< #{expression.slice}",
114
+ kind: Constant::SymbolKind::NAMESPACE,
115
+ range_location: node.location,
116
+ selection_range_location: expression.location,
117
+ )
118
+ end
119
+
120
+ sig { params(node: Prism::SingletonClassNode).void }
121
+ def on_singleton_class_node_leave(node)
122
+ @stack.pop
123
+ end
124
+
106
125
  sig { params(node: Prism::CallNode).void }
107
126
  def on_call_node_enter(node)
108
127
  return unless ATTR_ACCESSORS.include?(node.name) && node.receiver.nil?
@@ -163,10 +182,14 @@ module RubyLsp
163
182
  sig { params(node: Prism::DefNode).void }
164
183
  def on_def_node_enter(node)
165
184
  receiver = node.receiver
185
+ previous_symbol = @stack.last
166
186
 
167
187
  if receiver.is_a?(Prism::SelfNode)
168
188
  name = "self.#{node.name}"
169
- kind = Constant::SymbolKind::METHOD
189
+ kind = Constant::SymbolKind::FUNCTION
190
+ elsif previous_symbol.is_a?(Interface::DocumentSymbol) && previous_symbol.name.start_with?("<<")
191
+ name = node.name.to_s
192
+ kind = Constant::SymbolKind::FUNCTION
170
193
  else
171
194
  name = node.name.to_s
172
195
  kind = name == "initialize" ? Constant::SymbolKind::CONSTRUCTOR : Constant::SymbolKind::METHOD
@@ -58,7 +58,7 @@ module RubyLsp
58
58
 
59
59
  sig { void }
60
60
  def start
61
- warn("Starting Ruby LSP...")
61
+ warn("Starting Ruby LSP v#{VERSION}...")
62
62
 
63
63
  # Requests that have to be executed sequentially or in the main process are implemented here. All other requests
64
64
  # fall under the else branch which just pushes requests to the queue
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.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-26 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: language_server-protocol