1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Ignore parenthesis during completion

Rename method

https://github.com/ruby/irb/commit/619aecb412
This commit is contained in:
Kaíque Kandy Koga 2021-10-10 16:30:42 -03:00 committed by git
parent 38d255d023
commit 5c646ca0a0
2 changed files with 8 additions and 1 deletions

View file

@ -197,7 +197,7 @@ module IRB
end
candidates.grep(/^#{Regexp.quote(sym)}/)
when /^::([A-Z][^:\.\(]*)$/
when /^::([A-Z][^:\.\(\)]*)$/
# Absolute Constant or class methods
receiver = $1
candidates = Object.constants.collect{|m| m.to_s}

View file

@ -41,6 +41,13 @@ module TestIRB
assert_empty(IRB::InputCompletor.retrieve_completion_data(":::", bind: binding))
end
def test_complete_absolute_constants_with_special_characters
assert_empty(IRB::InputCompletor.retrieve_completion_data("::A:", bind: binding))
assert_empty(IRB::InputCompletor.retrieve_completion_data("::A.", bind: binding))
assert_empty(IRB::InputCompletor.retrieve_completion_data("::A(", bind: binding))
assert_empty(IRB::InputCompletor.retrieve_completion_data("::A)", bind: binding))
end
def test_complete_symbol_failure
assert_nil(IRB::InputCompletor::PerfectMatchedProc.(":aiueo", bind: binding))
end