From 2159798f4c0f71007db733cddd82b99186c8e424 Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 16 Sep 2020 11:19:17 +0900 Subject: Merge IRB 1.2.6 --- lib/irb/completion.rb | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'lib/irb/completion.rb') diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index c44aa9039e..c9328e5c5a 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -7,7 +7,6 @@ # From Original Idea of shugo@ruby-lang.org # -require "readline" autoload :RDoc, "rdoc" module IRB @@ -97,17 +96,13 @@ module IRB when /^(:[^:.]*)$/ # Symbol return nil if doc_namespace - if Symbol.respond_to?(:all_symbols) - sym = $1 - candidates = Symbol.all_symbols.collect do |s| - ":" + s.id2name.encode(Encoding.default_external) - rescue Encoding::UndefinedConversionError - # ignore - end - candidates.grep(/^#{Regexp.quote(sym)}/) - else - [] + sym = $1 + candidates = Symbol.all_symbols.collect do |s| + ":" + s.id2name.encode(Encoding.default_external) + rescue Encoding::UndefinedConversionError + # ignore end + candidates.grep(/^#{Regexp.quote(sym)}/) when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods -- cgit v1.2.3