From cda0511e0384dff94271d522a7855d17626c7c78 Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Mon, 25 Mar 2024 15:22:25 -0400 Subject: [PATCH 1/2] Apply indexing configuration to ruby-lsp-doctor --- exe/ruby-lsp-doctor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exe/ruby-lsp-doctor b/exe/ruby-lsp-doctor index 0680c733c..96bfbedf4 100755 --- a/exe/ruby-lsp-doctor +++ b/exe/ruby-lsp-doctor @@ -4,6 +4,9 @@ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) require "ruby_lsp/internal" +if File.exist?(".index.yml") + RubyIndexer.configuration.apply_config(YAML.parse_file(".index.yml").to_ruby) +end index = RubyIndexer::Index.new puts "Globbing for indexable files" From 940c35d58588a7b4aee9b9669cf3f86ce23cefee Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Wed, 27 Mar 2024 14:48:49 -0400 Subject: [PATCH 2/2] Abort if reading config fails --- exe/ruby-lsp-doctor | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exe/ruby-lsp-doctor b/exe/ruby-lsp-doctor index 96bfbedf4..0bc944a2c 100755 --- a/exe/ruby-lsp-doctor +++ b/exe/ruby-lsp-doctor @@ -5,8 +5,14 @@ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) require "ruby_lsp/internal" if File.exist?(".index.yml") - RubyIndexer.configuration.apply_config(YAML.parse_file(".index.yml").to_ruby) + 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"