Class: RubyLsp::Requests::DocumentSymbol
- Defined in:
- lib/ruby_lsp/requests/document_symbol.rb
Overview
The [document symbol](microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) request informs the editor of all the important symbols, such as classes, variables, and methods, defined in a file. With this information, the editor can populate breadcrumbs, file outline and allow for fuzzy symbol searches.
In VS Code, symbol search known as ‘Go To Symbol in Editor’ and can be accessed with Ctrl/Cmd-Shift-O, or by opening the command palette and inserting an ‘@` symbol.
Class Method Summary collapse
-
.provider ⇒ Object
: -> Interface::DocumentSymbolOptions.
Instance Method Summary collapse
-
#initialize(uri, dispatcher) ⇒ DocumentSymbol
constructor
: (URI::Generic uri, Prism::Dispatcher dispatcher) -> void.
-
#perform ⇒ Object
: -> Array.
Constructor Details
#initialize(uri, dispatcher) ⇒ DocumentSymbol
: (URI::Generic uri, Prism::Dispatcher dispatcher) -> void
24 25 26 27 28 29 30 31 32 |
# File 'lib/ruby_lsp/requests/document_symbol.rb', line 24 def initialize(uri, dispatcher) super() @response_builder = ResponseBuilders::DocumentSymbol.new #: ResponseBuilders::DocumentSymbol Listeners::DocumentSymbol.new(@response_builder, uri, dispatcher) Addon.addons.each do |addon| addon.create_document_symbol_listener(@response_builder, dispatcher) end end |
Class Method Details
.provider ⇒ Object
: -> Interface::DocumentSymbolOptions
18 19 20 |
# File 'lib/ruby_lsp/requests/document_symbol.rb', line 18 def provider Interface::DocumentSymbolOptions.new end |
Instance Method Details
#perform ⇒ Object
: -> Array
36 37 38 |
# File 'lib/ruby_lsp/requests/document_symbol.rb', line 36 def perform @response_builder.response end |