Skip to content

Commit

Permalink
Don't filter out SingletonClass
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Aug 28, 2024
1 parent f5665fb commit 7b8c18e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ruby_indexer/lib/ruby_indexer/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def existing_or_new_singleton_class(name)
def entries_for(path, type = nil)
type = Entry if type.nil?

Array(@files_to_entries[path]).grep(type).grep_v(RubyIndexer::Entry::SingletonClass)
Array(@files_to_entries[path]).grep(type)
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_indexer/test/index_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1854,10 +1854,10 @@ def self.my_singleton_def; end
RUBY

entries = @index.entries_for("/fake/path/foo.rb")
assert_equal(["Foo", "Bar", "my_def", "my_singleton_def"], entries.map(&:name))
assert_equal(["Foo", "Bar", "my_def", "Bar::<Class:Bar>", "my_singleton_def"], entries.map(&:name))

entries = @index.entries_for("/fake/path/foo.rb", RubyIndexer::Entry::Namespace)
assert_equal(["Foo", "Bar"], entries.map(&:name))
assert_equal(["Foo", "Bar", "Bar::<Class:Bar>"], entries.map(&:name))
end

def test_entries_for_returns_nil_if_no_matches
Expand Down

0 comments on commit 7b8c18e

Please sign in to comment.