From ed8f8cdc2f8a48100c1535e277d7c6ad537a4c35 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Tue, 28 Jul 2026 14:18:36 -0400 Subject: [PATCH] Use `find_latest_files` for loading add-ons --- lib/ruby_lsp/addon.rb | 2 +- test/addon_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ruby_lsp/addon.rb b/lib/ruby_lsp/addon.rb index c03300094..91102e3c6 100644 --- a/lib/ruby_lsp/addon.rb +++ b/lib/ruby_lsp/addon.rb @@ -53,7 +53,7 @@ def load_addons(global_state, outgoing_queue, include_project_addons: true) # Require all add-ons entry points, which should be placed under # `some_gem/lib/ruby_lsp/your_gem_name/addon.rb` or in the workspace under # `your_project/ruby_lsp/project_name/addon.rb` - addon_files = Gem.find_files("ruby_lsp/**/addon.rb") + addon_files = Gem.find_latest_files("ruby_lsp/**/addon.rb") if include_project_addons bundle_path = begin diff --git a/test/addon_test.rb b/test/addon_test.rb index 8e88ba8d8..64e327d88 100644 --- a/test/addon_test.rb +++ b/test/addon_test.rb @@ -378,7 +378,7 @@ def version }) expected_addon_path = File.join(dir, "vendor", "bundle", "rubocop-1.73.0", "lib", "ruby_lsp", "rubocop", "addon.rb") - Gem.stubs(:find_files).with("ruby_lsp/**/addon.rb").returns([expected_addon_path]) + Gem.stubs(:find_latest_files).with("ruby_lsp/**/addon.rb").returns([expected_addon_path]) Bundler.stubs(:bundle_path).returns(Pathname.new(File.join(dir, "vendor", "bundle"))) Addon.load_addons(@global_state, @outgoing_queue)