diff --git a/lib/ruby_indexer/lib/ruby_indexer/index.rb b/lib/ruby_indexer/lib/ruby_indexer/index.rb index 7e12bf470..9e63ffedc 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/index.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/index.rb @@ -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 diff --git a/lib/ruby_indexer/test/index_test.rb b/lib/ruby_indexer/test/index_test.rb index 666562ed2..b34989608 100644 --- a/lib/ruby_indexer/test/index_test.rb +++ b/lib/ruby_indexer/test/index_test.rb @@ -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::", "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::"], entries.map(&:name)) end def test_entries_for_returns_nil_if_no_matches