--mimepart_4d1ab4a12d8cc_3346b7dbb2a6314
Content-Type: text/plain
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline

Feature #4222: Irb tab completion support for the valid (but rare) obj::method invocation syntax
http://redmine.ruby-lang.org/issues/show/4222

Author: Abinoam P. Marques Jr.
Status: Open, Priority: Low

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::<press tab> No tab-completion from irb.

a.<press tab> 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 uby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
Ubuntu 10.04 amd64


----------------------------------------
http://redmine.ruby-lang.org

--mimepart_4d1ab4a12d8cc_3346b7dbb2a6314
Content-Type: text/x-patch; name=tab-completion-for-rare-method-invocation-syntax.patch
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename=tab-completion-for-rare-method-invocation-syntax.patch

SW5kZXg6IGxpYi9pcmIvY29tcGxldGlvbi5yYgo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09Ci0tLSBsaWIvaXJiL2NvbXBsZXRpb24ucmIJKHJldmlzw6NvIDMw
NDE3KQorKysgbGliL2lyYi9jb21wbGV0aW9uLnJiCShjw7NwaWEgZGUgdHJh
YmFsaG8pCkBAIC0xMzEsNyArMTMxLDggQEAKIAogIyAgICAgIHdoZW4gL14o
XCQ/KFwuP1teLl0rKSspXC4oW14uXSopJC8KICMgICAgICB3aGVuIC9eKChc
Lj9bXi5dKykrKVwuKFteLl0qKSQvCi0gICAgICB3aGVuIC9eKFteLiJdLiop
XC4oW14uXSopJC8KKyMgICAgICB3aGVuIC9eKFteLiJdLiopXC4oW14uXSop
JC8KKyAgICAgIHdoZW4gL14oW14uIl0uKikoPzpcLnw6OikoW14uXSopJC8K
IAkjIHZhcmlhYmxlCiAJcmVjZWl2ZXIgPSAkMQogCW1lc3NhZ2UgPSBSZWdl
eHAucXVvdGUoJDIpCg
--mimepart_4d1ab4a12d8cc_3346b7dbb2a6314--