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.) almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
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 #1

Updated by yugui (Yuki Sonoda) almost 12 years ago

=begin
Thank you, Abinoam.

On Wed, Dec 29, 2010 at 1:10 PM, Abinoam P. Marques Jr.
wrote:

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

Keiju, Is it an intended feature or just a lack of implementation?

--
Yuki Sonoda (Yugui)

http://yugui.jp

=end

Actions #2

Updated by yugui (Yuki Sonoda) almost 12 years ago

  • Category set to lib
  • Status changed from Open to Assigned
  • Assignee set to keiju (Keiju Ishitsuka)
  • Priority changed from 3 to Normal
  • Target version set to 1.9.3

=begin

=end

Actions #3

Updated by yugui (Yuki Sonoda) almost 12 years ago

=begin
石塚さん、

[ruby-core:33987]の件、現状が意図した仕様という訳でないならばマージしようかと思いますが、どうでしょうか。

---------- Forwarded message ----------
From: Abinoam P. Marques Jr.
Date: Wed, Dec 29, 2010 at 1:10 PM
Subject: [ruby-core:33987] [Ruby 1.9-Feature#4222][Open] Irb tab
completion support for the valid (but rare) obj::method invocation
syntax
To:

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::

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


http://redmine.ruby-lang.org

--
Yuki Sonoda (Yugui)

http://yugui.jp

Attachment: tab-completion-for-rare-method-invocation-syntax.patch
=end

Actions #4

Updated by keiju (Keiju Ishitsuka) almost 12 years ago

=begin
けいじゅ@いしつかです.

Yugui wrote:

石塚さん、

どもです.

[ruby-core:33987]の件、現状が意図した仕様という訳でないならばマージ
しようかと思いますが、どうでしょうか。

これで良いような気もしますが, ちょっと微妙なのでもうちょっと待ってくだ
さい. :: と . って微妙に振る舞いが違うようなんですよねぇ...

__
---------------------------------------------------->> 石塚 圭樹 <<---
---------------------------------->> e-mail: <<---

=end

Actions #5

Updated by keiju (Keiju Ishitsuka) almost 12 years ago

=begin
けいじゅ@いしつかです.

In [ruby-dev:43049] the message: "[ruby-dev:43049] Re: Fwd:
[ruby-core:33987] [Ruby 1.9-Feature#4222][Open] Irb tab completion
support for the valid (but rare) obj::method invocation syntax", on
Jan/17 13:27(JST) keiju ISHITSUKA writes:

けいじゅ@いしつかです.

[ruby-core:33987]の件、現状が意図した仕様という訳でないならばマージ
しようかと思いますが、どうでしょうか。

これで良いような気もしますが, ちょっと微妙なのでもうちょっと待ってくだ
さい. :: と . って微妙に振る舞いが違うようなんですよねぇ...

対応しました.

var::xxx は varがmoduleでxxxが大文字から始まっていると定数参照になるの
でその対応と, 変数以外の xxx:: に対応しました.

__
---------------------------------------------------->> 石塚 圭樹 <<---
---------------------------------->> e-mail: <<---

=end

Updated by keiju (Keiju Ishitsuka) over 11 years ago

  • Status changed from Assigned to Closed

これはすでに対応していました。

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0