Class: RubyLsp::Requests::InlayHints

Inherits:
Request
  • Object
show all
Defined in:
lib/ruby_lsp/requests/inlay_hints.rb

Overview

[Inlay hints](microsoft.github.io/language-server-protocol/specification#textDocument_inlayHint) are labels added directly in the code that explicitly show the user something that might otherwise just be implied.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(global_state, document, dispatcher) ⇒ InlayHints

: (GlobalState, (RubyDocument | ERBDocument), Prism::Dispatcher) -> void



20
21
22
23
24
25
26
# File 'lib/ruby_lsp/requests/inlay_hints.rb', line 20

def initialize(global_state, document, dispatcher)
  super()

  @response_builder = ResponseBuilders::CollectionResponseBuilder
    .new #: ResponseBuilders::CollectionResponseBuilder[Interface::InlayHint]
  Listeners::InlayHints.new(global_state, @response_builder, dispatcher)
end

Class Method Details

.providerObject

: -> Interface::InlayHintOptions



14
15
16
# File 'lib/ruby_lsp/requests/inlay_hints.rb', line 14

def provider
  Interface::InlayHintOptions.new(resolve_provider: false)
end

Instance Method Details

#performObject

: -> Array



30
31
32
# File 'lib/ruby_lsp/requests/inlay_hints.rb', line 30

def perform
  @response_builder.response
end