#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) require "ruby_lsp/internal" if File.exist?(".index.yml") begin config = YAML.parse_file(".index.yml").to_ruby rescue => e abort("Error parsing config: #{e.message}") end RubyIndexer.configuration.apply_config(config) end index = RubyIndexer::Index.new puts "Globbing for indexable files" RubyIndexer.configuration.indexables.each do |indexable| puts "indexing: #{indexable.full_path}" content = File.read(indexable.full_path) result = Prism.parse(content) collector = RubyIndexer::Collector.new(index, result, indexable.full_path) collector.collect(result.value) end