Created
December 5, 2012 16:02
-
-
Save tarui/4216894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: lib/irb/completion.rb | |
=================================================================== | |
--- lib/irb/completion.rb (revision 38221) | |
+++ lib/irb/completion.rb (working copy) | |
@@ -152,9 +152,10 @@ | |
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 @@ | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment