Project

General

Profile

Actions

Feature #4222

closed

Irb tab completion support for the valid (but rare) obj::method invocation syntax

Added by abinoam (Abinoam P. Marques Jr.) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
[ruby-core:33987]

Description

=begin
class MyC
def my_method
true
end
end

a = MyC.new

This is a valid method invocation syntax (rare, but valid)

a::my_method # => true

But when you type in irb

a::

No tab-completion from irb.

a. is working well.

So, I think the small patch bellow could implement this feature.

Index: lib/irb/completion.rb

--- lib/irb/completion.rb (revisão 30417)
+++ lib/irb/completion.rb (cópia de trabalho)
@@ -131,7 +131,8 @@

when /^($?(.?[^.]+)+).([^.]*)$/

when /^((.?[^.]+)+).([^.]*)$/

  •  when /^([^."].*)\.([^.]*)$/
    

+# when /^([^."].).([^.])$/

  •  when /^([^."].*)(?:\.|::)([^.]*)$/
    

    variable

    receiver = $1
    message = Regexp.quote($2)

I'm at
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
Ubuntu 10.04 amd64
=end


Files

tab-completion-for-rare-method-invocation-syntax.patch (463 Bytes) tab-completion-for-rare-method-invocation-syntax.patch Add irb tab completion support for the valid (but rare) obj::method invocation syntax abinoam (Abinoam P. Marques Jr.), 12/29/2010 01:10 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0