@@ -204,10 +204,10 @@ module RubyLsp
204
204
" 0.1.0"
205
205
end
206
206
207
- def create_hover_listener (response_builder , node_context , index , dispatcher )
207
+ def create_hover_listener (response_builder , node_context , dispatcher )
208
208
# Use the listener factory methods to instantiate listeners with parameters sent by the LSP combined with any
209
209
# pre-computed information in the add-on. These factory methods are invoked on every request
210
- Hover .new (client, response_builder, @config , dispatcher)
210
+ Hover .new (response_builder, @config , dispatcher)
211
211
end
212
212
end
213
213
@@ -222,10 +222,7 @@ module RubyLsp
222
222
# to this object, which will then build the Ruby LSP's response.
223
223
# Additionally, listeners are instantiated with a message_queue to push notifications (not used in this example).
224
224
# See "Sending notifications to the client" for more information.
225
- def initialize (client , response_builder , config , dispatcher )
226
- super (dispatcher)
227
-
228
- @client = client
225
+ def initialize (response_builder , config , dispatcher )
229
226
@response_builder = response_builder
230
227
@config = config
231
228
@@ -293,18 +290,17 @@ class MyIndexingEnhancement < RubyIndexer::Enhancement
293
290
# Create the array of signatures that this method will accept. Every signatures is composed of a list of
294
291
# parameters. The parameter classes represent each type of parameter
295
292
signatures = [
296
- Entry ::Signature .new ([Entry ::RequiredParameter .new (name: :a )])
293
+ RubyIndexer :: Entry ::Signature .new ([RubyIndexer :: Entry ::RequiredParameter .new (name: :a )])
297
294
]
298
295
299
- new_entry = Entry ::Method .new (
296
+ new_entry = RubyIndexer :: Entry ::Method .new (
300
297
" new_method" , # The name of the method that gets created via meta-programming
301
298
file_path, # The file_path where the DSL call was found. This should always just be the file_path received
302
299
location, # The Prism node location where the DSL call was found
303
300
location, # The Prism node location for the DSL name location. May or not be the same
304
301
nil , # The documentation for this DSL call. This should always be `nil` to ensure lazy fetching of docs
305
- @index .configuration.encoding, # The negotiated encoding. This should always be `indexing.configuration.encoding`
306
302
signatures, # All signatures for this method (every way it can be invoked)
307
- Entry ::Visibility ::PUBLIC , # The method's visibility
303
+ RubyIndexer :: Entry ::Visibility ::PUBLIC , # The method's visibility
308
304
owner, # The method's owner. This is almost always going to be the same owner received
309
305
)
310
306
@@ -326,7 +322,7 @@ module RubyLsp
326
322
class Addon < ::RubyLsp ::Addon
327
323
def activate (global_state , message_queue )
328
324
# Register the enhancement as part of the indexing process
329
- @ index .register_enhancement(MyIndexingEnhancement .new (@ index ))
325
+ global_state. index.register_enhancement(MyIndexingEnhancement .new (global_state. index))
330
326
end
331
327
332
328
def deactivate
0 commit comments