1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Show documents when completion

This commit is contained in:
aycabta 2019-04-28 07:47:33 +09:00
parent 260235ce87
commit 559dca509d
4 changed files with 12 additions and 1 deletions

View file

@ -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[% & * ** + - / < << <= <=> == === =~ > >= >> [] []= ^ ! != !~]

View file

@ -222,6 +222,7 @@ module IRB
end
Reline.completion_append_character = nil
Reline.completion_proc = IRB::InputCompletor::CompletionProc
Reline.dig_perfect_match_proc = IRB::InputCompletor::PerfectMatchedProc
end
def check_termination(&block)

View file

@ -1,5 +1,5 @@
# frozen_string_literal: true
require 'rdoc/ri'
require 'rdoc/rdoc'
##
# The directories where ri data lives. Paths can be enumerated via ::each, or

View file

@ -18,6 +18,7 @@ require 'rubygems/compatibility'
require 'rubygems/defaults'
require 'rubygems/deprecate'
require 'rubygems/errors'
require 'rubygems/path_support'
##
# RubyGems is the Ruby standard for publishing and managing third party