Class: Ibex::LSP::SymbolIndexBuilder
- Inherits:
-
Object
- Object
- Ibex::LSP::SymbolIndexBuilder
- Defined in:
- lib/ibex/lsp/symbol_index_builder.rb
Overview
Builds source occurrences and hover metadata from lossless frontend documents.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(store, files) ⇒ SymbolIndexBuilder
constructor
A new instance of SymbolIndexBuilder.
Constructor Details
#initialize(store, files) ⇒ SymbolIndexBuilder
Returns a new instance of SymbolIndexBuilder.
11 12 13 14 15 16 17 18 19 |
# File 'lib/ibex/lsp/symbol_index_builder.rb', line 11 def initialize(store, files) @store = store @files = files @occurrences = [] #: Array[SymbolOccurrence] @documents = {} #: Hash[String, Frontend::SourceDocument] @global_kinds = {} #: Hash[String, Symbol] @rule_data = {} #: Hash[String, Hash[Symbol, untyped]] @terminal_data = Hash.new { |hash, key| hash[key] = {} } #: Hash[String, Hash[Symbol, untyped]] end |
Instance Method Details
#build ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/ibex/lsp/symbol_index_builder.rb', line 22 def build collect_documents # Definitions from every closure file must exist before references are classified. # rubocop:disable Style/CombinableLoops @documents.each { |path, document| collect_definitions(path, document) } @documents.each { |path, document| collect_references(path, document) } # rubocop:enable Style/CombinableLoops [@occurrences.freeze, @documents.freeze] end |