lib/ruby_indexer/lib/ruby_indexer/index.rb in ruby-lsp-0.17.12 vs lib/ruby_indexer/lib/ruby_indexer/index.rb in ruby-lsp-0.17.13

- old
+ new

@@ -9,10 +9,13 @@ class NonExistingNamespaceError < StandardError; end # The minimum Jaro-Winkler similarity score for an entry to be considered a match for a given fuzzy search query ENTRY_SIMILARITY_THRESHOLD = 0.7 + sig { returns(Configuration) } + attr_reader :configuration + sig { void } def initialize # Holds all entries in the index using the following format: # { # "Foo" => [#<Entry::Class>, #<Entry::Class>], @@ -42,10 +45,12 @@ # Map of module name to included hooks that have to be executed when we include the given module @included_hooks = T.let( {}, T::Hash[String, T::Array[T.proc.params(index: Index, base: Entry::Namespace).void]], ) + + @configuration = T.let(RubyIndexer::Configuration.new, Configuration) end # Register an enhancement to the index. Enhancements must conform to the `Enhancement` interface sig { params(enhancement: Enhancement).void } def register_enhancement(enhancement) @@ -294,10 +299,10 @@ params( indexable_paths: T::Array[IndexablePath], block: T.nilable(T.proc.params(progress: Integer).returns(T::Boolean)), ).void end - def index_all(indexable_paths: RubyIndexer.configuration.indexables, &block) + def index_all(indexable_paths: @configuration.indexables, &block) RBSIndexer.new(self).index_ruby_core # Calculate how many paths are worth 1% of progress progress_step = (indexable_paths.length / 100.0).ceil indexable_paths.each_with_index do |path, index|