mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb/completion.rb (CompletionProc): support completion of
instance variables. [ruby-dev:46710] [Bug #7520] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d73872f3bc
commit
349b20cc91
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Dec 21 01:01:45 2012 Masaya Tarui <tarui@ruby-lang.org>
|
||||
|
||||
* lib/irb/completion.rb (CompletionProc): support completion of
|
||||
instance variables. [ruby-dev:46710] [Bug #7520]
|
||||
|
||||
Thu Dec 20 20:58:25 2012 Masaya Tarui <tarui@ruby-lang.org>
|
||||
|
||||
* vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_running
|
||||
|
|
|
@ -152,9 +152,10 @@ module IRB
|
|||
|
||||
gv = eval("global_variables", bind).collect{|m| m.to_s}
|
||||
lv = eval("local_variables", bind).collect{|m| m.to_s}
|
||||
iv = eval("instance_variables", bind).collect{|m| m.to_s}
|
||||
cv = eval("self.class.constants", bind).collect{|m| m.to_s}
|
||||
|
||||
if (gv | lv | cv).include?(receiver) or /^[A-Z]/ =~ receiver && /\./ !~ receiver
|
||||
if (gv | lv | iv | cv).include?(receiver) or /^[A-Z]/ =~ receiver && /\./ !~ receiver
|
||||
# foo.func and foo is var. OR
|
||||
# foo::func and foo is var. OR
|
||||
# foo::Const and foo is var. OR
|
||||
|
@ -201,7 +202,7 @@ module IRB
|
|||
select_message(receiver, message, candidates)
|
||||
|
||||
else
|
||||
candidates = eval("methods | private_methods | local_variables | self.class.constants", bind).collect{|m| m.to_s}
|
||||
candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
|
||||
|
||||
(candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue