@@ -724,7 +724,7 @@ def _reset_completion_defaults(self) -> None:
724
724
# noinspection PyUnresolvedReferences
725
725
readline .rl .mode ._display_completions = self ._display_matches_pyreadline
726
726
727
- def _tokens_for_completion (self , line : str , begidx : int , endidx : int ) -> Tuple [List [str ], List [str ]]:
727
+ def tokens_for_completion (self , line : str , begidx : int , endidx : int ) -> Tuple [List [str ], List [str ]]:
728
728
"""
729
729
Used by tab completion functions to get all tokens through the one being completed
730
730
:param line: the current input line with leading whitespace removed
@@ -938,7 +938,7 @@ def flag_based_complete(self, text: str, line: str, begidx: int, endidx: int,
938
938
:return: a list of possible tab completions
939
939
"""
940
940
# Get all tokens through the one being completed
941
- tokens , _ = self ._tokens_for_completion (line , begidx , endidx )
941
+ tokens , _ = self .tokens_for_completion (line , begidx , endidx )
942
942
if not tokens :
943
943
return []
944
944
@@ -980,7 +980,7 @@ def index_based_complete(self, text: str, line: str, begidx: int, endidx: int,
980
980
:return: a list of possible tab completions
981
981
"""
982
982
# Get all tokens through the one being completed
983
- tokens , _ = self ._tokens_for_completion (line , begidx , endidx )
983
+ tokens , _ = self .tokens_for_completion (line , begidx , endidx )
984
984
if not tokens :
985
985
return []
986
986
@@ -1192,7 +1192,7 @@ def _redirect_complete(self, text: str, line: str, begidx: int, endidx: int, com
1192
1192
1193
1193
# Get all tokens through the one being completed. We want the raw tokens
1194
1194
# so we can tell if redirection strings are quoted and ignore them.
1195
- _ , raw_tokens = self ._tokens_for_completion (line , begidx , endidx )
1195
+ _ , raw_tokens = self .tokens_for_completion (line , begidx , endidx )
1196
1196
if not raw_tokens :
1197
1197
return []
1198
1198
@@ -1397,7 +1397,7 @@ def _complete_worker(self, text: str, state: int) -> Optional[str]:
1397
1397
line = expanded_line
1398
1398
1399
1399
# Get all tokens through the one being completed
1400
- tokens , raw_tokens = self ._tokens_for_completion (line , begidx , endidx )
1400
+ tokens , raw_tokens = self .tokens_for_completion (line , begidx , endidx )
1401
1401
1402
1402
# Check if we either had a parsing error or are trying to complete the command token
1403
1403
# The latter can happen if " or ' was entered as the command
@@ -1570,7 +1570,7 @@ def _autocomplete_default(self, text: str, line: str, begidx: int, endidx: int,
1570
1570
"""Default completion function for argparse commands."""
1571
1571
completer = AutoCompleter (argparser , self )
1572
1572
1573
- tokens , _ = self ._tokens_for_completion (line , begidx , endidx )
1573
+ tokens , _ = self .tokens_for_completion (line , begidx , endidx )
1574
1574
if not tokens :
1575
1575
return []
1576
1576
@@ -2607,7 +2607,7 @@ def complete_help_subcommand(self, text: str, line: str, begidx: int, endidx: in
2607
2607
"""Completes the subcommand argument of help"""
2608
2608
2609
2609
# Get all tokens through the one being completed
2610
- tokens , _ = self ._tokens_for_completion (line , begidx , endidx )
2610
+ tokens , _ = self .tokens_for_completion (line , begidx , endidx )
2611
2611
2612
2612
if not tokens :
2613
2613
return []
0 commit comments