From 559dca509d2a98584b09c7d9a6d74749ce793ad7 Mon Sep 17 00:00:00 2001 From: aycabta Date: Sun, 28 Apr 2019 07:47:33 +0900 Subject: Show documents when completion --- lib/irb/completion.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/irb/completion.rb') diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 289180a3b2..573f2ed3e6 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -8,6 +8,7 @@ # require "readline" +require "rdoc" module IRB module InputCompletor # :nodoc: @@ -197,6 +198,14 @@ module IRB end } + RDocRIDriver = RDoc::RI::Driver.new + PerfectMatchedProc = proc { |matched| + begin + RDocRIDriver.display_name(matched) + rescue RDoc::RI::Driver::NotFoundError + end + } + # Set of available operators in Ruby Operators = %w[% & * ** + - / < << <= <=> == === =~ > >= >> [] []= ^ ! != !~] -- cgit v1.2.3