diff options
Diffstat (limited to 'lib/irb/completion.rb')
| -rw-r--r-- | lib/irb/completion.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb deleted file mode 100644 index cbd4012773..0000000000 --- a/lib/irb/completion.rb +++ /dev/null @@ -1,47 +0,0 @@ - -require "readline" - -module IRB - module InputCompletion - ReservedWords = [ - "BEGIN", "END", - "alias", "and", - "begin", "break", - "case", "class", - "def", "defined", "do", - "else", "elsif", "end", "ensure", - "false", "for", - "if", "in", - "module", - "next", "nil", "not", - "or", - "redo", "rescue", "retry", "return", - "self", "super", - "then", "true", - "undef", "unless", "until", - "when", "while", - "yield" - ] - - CompletionProc = proc { |input| - case input - when /^([^.]+)\.([^.]*)$/ - receiver = $1 - message = $2 - if eval("(local_variables|#{receiver}.type.constants).include?('#{receiver}')", - IRB.conf[:MAIN_CONTEXT].bind) - candidates = eval("#{receiver}.methods", IRB.conf[:MAIN_CONTEXT].bind) - else - candidates = [] - end - candidates.grep(/^#{Regexp.quote(message)}/).collect{|e| receiver + "." + e} - else - candidates = eval("methods | private_methods | local_variables | type.constants", - IRB.conf[:MAIN_CONTEXT].bind) - (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/) - end - } - end -end - -Readline.completion_proc = IRB::InputCompletion::CompletionProc |
