File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1010 Ruby commit r30811 by Usaku Nakamura.
1111 * Remove unnecessary (and wrong) platform-dependent hacks. Ruby commit
1212 r30829 by Usaku Nakamura.
13- * Completing via Array#[<tab> in `ri -i` no longer crashes.
13+ * Completing via Array#[ in `ri -i` no longer crashes. Ruby Bug #3167
14+ * Completing IO::o in `ri -i` now returns results. Ruby Bug #3167
1415
1516=== 3.5.3 / 2010-02-06
1617
Original file line number Diff line number Diff line change @@ -526,6 +526,8 @@ def complete name
526526 if name !~ /#|\. / then
527527 completions = klasses . grep ( /^#{ klass_name } [^:]*$/ )
528528 completions . concat klasses . grep ( /^#{ name } [^:]*$/ ) if name =~ /::$/
529+
530+ completions << klass if classes . key? klass # to complete a method name
529531 elsif selector then
530532 completions << klass if classes . key? klass
531533 elsif classes . key? klass_name then
@@ -547,7 +549,7 @@ def complete name
547549 completions . push ( *methods )
548550 end
549551
550- completions . sort
552+ completions . sort . uniq
551553 end
552554
553555 ##
Original file line number Diff line number Diff line change 33require 'minitest/autorun'
44require 'tmpdir'
55require 'fileutils'
6+ require 'stringio'
67require 'rdoc/ri/driver'
78
89class TestRDocRIDriver < MiniTest ::Unit ::TestCase
@@ -252,9 +253,11 @@ def test_complete
252253 assert_equal %w[ Foo ] , @driver . complete ( 'F' )
253254 assert_equal %w[ Foo::Bar ] , @driver . complete ( 'Foo::B' )
254255
255- assert_equal %w[ Foo#Bar ] , @driver . complete ( 'Foo#' ) , 'Foo#'
256- assert_equal %w[ Foo#Bar Foo::bar ] , @driver . complete ( 'Foo.' ) , 'Foo.'
257- assert_equal %w[ Foo::Bar Foo::bar ] , @driver . complete ( 'Foo::' ) , 'Foo::'
256+ assert_equal %w[ Foo#Bar ] , @driver . complete ( 'Foo#' ) , 'Foo#'
257+ assert_equal %w[ Foo#Bar Foo::bar ] , @driver . complete ( 'Foo.' ) , 'Foo.'
258+ assert_equal %w[ Foo::Bar Foo::bar ] , @driver . complete ( 'Foo::' ) , 'Foo::'
259+
260+ assert_equal %w[ Foo::bar ] , @driver . complete ( 'Foo::b' ) , 'Foo::b'
258261 end
259262
260263 def test_complete_ancestor
You can’t perform that action at this time.
0 commit comments