File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -293,11 +293,13 @@ def constant_completion_candidates(name, nesting)
293
293
entries . concat ( @entries_tree . search ( name ) )
294
294
295
295
# Filter only constants since methods may have names that look like constants
296
- entries . each do |definitions |
296
+ entries . select! do |definitions |
297
297
definitions . select! do |entry |
298
298
entry . is_a? ( Entry ::Constant ) || entry . is_a? ( Entry ::ConstantAlias ) ||
299
299
entry . is_a? ( Entry ::Namespace ) || entry . is_a? ( Entry ::UnresolvedConstantAlias )
300
300
end
301
+
302
+ definitions . any?
301
303
end
302
304
303
305
entries . uniq!
Original file line number Diff line number Diff line change @@ -1993,6 +1993,9 @@ def Qux
1993
1993
1994
1994
candidates = @index . constant_completion_candidates ( "Q" , [ ] )
1995
1995
refute_includes ( candidates . flat_map { |entries | entries . map ( &:name ) } , "Qux" )
1996
+
1997
+ candidates = @index . constant_completion_candidates ( "Qux" , [ ] )
1998
+ assert_equal ( 0 , candidates . length )
1996
1999
end
1997
2000
1998
2001
def test_constant_completion_candidates_for_empty_name
You can’t perform that action at this time.
0 commit comments