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:
		
							parent
							
								
									260235ce87
								
							
						
					
					
						commit
						559dca509d
					
				
					 4 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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[% & * ** + - / < << <= <=> == === =~ > >= >> [] []= ^ ! != !~]
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue