File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ def execute
1414 str = "Ruby version: #{ RUBY_VERSION } \n "
1515 str += "IRB version: #{ IRB . version } \n "
1616 str += "InputMethod: #{ IRB . CurrentContext . io . inspect } \n "
17+ str += "Completion: #{ IRB . CurrentContext . io . respond_to? ( :completion_info ) ? IRB . CurrentContext . io . completion_info : 'off' } \n "
1718 str += ".irbrc path: #{ IRB . rc_file } \n " if File . exist? ( IRB . rc_file )
1819 str += "RUBY_PLATFORM: #{ RUBY_PLATFORM } \n "
1920 str += "LANG env: #{ ENV [ "LANG" ] } \n " if ENV [ "LANG" ] && !ENV [ "LANG" ] . empty?
Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ def eval_class_constants
9494 end
9595 }
9696
97+ def inspect
98+ 'RegexpCompletor'
99+ end
100+
97101 # Set of reserved words used by Ruby, you should not use these for
98102 # constants or variables
99103 ReservedWords = %w[
Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ def initialize
193193 }
194194 end
195195
196+ def completion_info
197+ 'RegexpCompletor'
198+ end
199+
196200 # Reads the next line from this input method.
197201 #
198202 # See IO#gets for more information.
@@ -270,6 +274,11 @@ def initialize(completor)
270274 end
271275 end
272276
277+ def completion_info
278+ autocomplete_message = IRB . conf [ :USE_AUTOCOMPLETE ] ? 'Autocomplete' : 'Tab Complete'
279+ "#{ autocomplete_message } , #{ @completor . inspect } "
280+ end
281+
273282 def check_termination ( &block )
274283 @check_termination_proc = block
275284 end
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ def test_irb_info_multiline
9090 Ruby\s version:\s .+\n
9191 IRB\s version:\s irb\s .+\n
9292 InputMethod:\s Abstract\s InputMethod\n
93+ Completion: .+\n
9394 \. irbrc\s path:\s .+\n
9495 RUBY_PLATFORM:\s .+\n
9596 East\s Asian\s Ambiguous\s Width:\s \d \n
@@ -113,6 +114,7 @@ def test_irb_info_singleline
113114 Ruby\s version:\s .+\n
114115 IRB\s version:\s irb\s .+\n
115116 InputMethod:\s Abstract\s InputMethod\n
117+ Completion: .+\n
116118 \. irbrc\s path:\s .+\n
117119 RUBY_PLATFORM:\s .+\n
118120 East\s Asian\s Ambiguous\s Width:\s \d \n
@@ -139,6 +141,7 @@ def test_irb_info_multiline_without_rc_files
139141 Ruby\s version:\s .+\n
140142 IRB\s version:\s irb\s .+\n
141143 InputMethod:\s Abstract\s InputMethod\n
144+ Completion: .+\n
142145 RUBY_PLATFORM:\s .+\n
143146 East\s Asian\s Ambiguous\s Width:\s \d \n
144147 #{ @is_win ? 'Code\spage:\s\d+\n' : '' }
@@ -168,6 +171,7 @@ def test_irb_info_singleline_without_rc_files
168171 Ruby\s version:\s .+\n
169172 IRB\s version:\s irb\s .+\n
170173 InputMethod:\s Abstract\s InputMethod\n
174+ Completion: .+\n
171175 RUBY_PLATFORM:\s .+\n
172176 East\s Asian\s Ambiguous\s Width:\s \d \n
173177 #{ @is_win ? 'Code\spage:\s\d+\n' : '' }
@@ -196,6 +200,7 @@ def test_irb_info_lang
196200 Ruby\s version: .+\n
197201 IRB\s version:\s irb .+\n
198202 InputMethod:\s Abstract\s InputMethod\n
203+ Completion: .+\n
199204 \. irbrc\s path: .+\n
200205 RUBY_PLATFORM: .+\n
201206 LANG\s env:\s ja_JP\. UTF-8\n
You can’t perform that action at this time.
0 commit comments