Sha256: 92e5ba06d9e6e3c0b4249deaccb51225a0faac793bfcd6d125c8eb45899071b7
Contents?: true
Size: 1.49 KB
Versions: 15
Compression:
Stored size: 1.49 KB
Contents
# typed: strict # frozen_string_literal: true require "ruby_lsp/listeners/document_symbol" module RubyLsp module Requests # The [document # symbol](https://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 DocumentSymbol < Request extend T::Sig class << self extend T::Sig sig { returns(Interface::DocumentSymbolOptions) } def provider Interface::DocumentSymbolOptions.new end end sig { params(uri: URI::Generic, dispatcher: Prism::Dispatcher).void } def initialize(uri, dispatcher) super() @response_builder = T.let(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 sig { override.returns(T::Array[Interface::DocumentSymbol]) } def perform @response_builder.response end end end end
Version data entries
15 entries across 15 versions & 1 rubygems