Skip to content

Commit

Permalink
Merge pull request #2039 from Shopify/ar/stop-generating-for-test-files
Browse files Browse the repository at this point in the history
Don't attempt to generate DSL RBIs for test files
  • Loading branch information
alexcrocha authored Oct 9, 2024
2 parents b0184c4 + 03de884 commit 044b21f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ruby_lsp/tapioca/addon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ def workspace_did_change_watched_files(changes)

constants = changes.flat_map do |change|
path = URI(change[:uri]).to_standardized_path
next if path.end_with?("_test.rb", "_spec.rb")

entries = T.must(@index).entries_for(path)
next unless entries

entries.filter_map do |entry|
entry.name if entry.class == RubyIndexer::Entry::Class || entry.class == RubyIndexer::Entry::Module
end
end
end.compact

return if constants.empty?

Expand Down

0 comments on commit 044b21f

Please sign in to comment.