Class: RubyLsp::Requests::InlayHints
- 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
-
.provider ⇒ Object
: -> Interface::InlayHintOptions.
Instance Method Summary collapse
-
#initialize(global_state, document, dispatcher) ⇒ InlayHints
constructor
: (GlobalState, (RubyDocument | ERBDocument), Prism::Dispatcher) -> void.
-
#perform ⇒ Object
: -> Array.
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
.provider ⇒ Object
: -> 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
#perform ⇒ Object
: -> Array
30 31 32 |
# File 'lib/ruby_lsp/requests/inlay_hints.rb', line 30 def perform @response_builder.response end |