@@ -724,7 +724,7 @@ def _reset_completion_defaults(self) -> None:
724724 # noinspection PyUnresolvedReferences
725725 readline .rl .mode ._display_completions = self ._display_matches_pyreadline
726726
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 ]]:
728728 """
729729 Used by tab completion functions to get all tokens through the one being completed
730730 :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,
938938 :return: a list of possible tab completions
939939 """
940940 # 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 )
942942 if not tokens :
943943 return []
944944
@@ -980,7 +980,7 @@ def index_based_complete(self, text: str, line: str, begidx: int, endidx: int,
980980 :return: a list of possible tab completions
981981 """
982982 # 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 )
984984 if not tokens :
985985 return []
986986
@@ -1192,7 +1192,7 @@ def _redirect_complete(self, text: str, line: str, begidx: int, endidx: int, com
11921192
11931193 # Get all tokens through the one being completed. We want the raw tokens
11941194 # 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 )
11961196 if not raw_tokens :
11971197 return []
11981198
@@ -1397,7 +1397,7 @@ def _complete_worker(self, text: str, state: int) -> Optional[str]:
13971397 line = expanded_line
13981398
13991399 # 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 )
14011401
14021402 # Check if we either had a parsing error or are trying to complete the command token
14031403 # 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,
15701570 """Default completion function for argparse commands."""
15711571 completer = AutoCompleter (argparser , self )
15721572
1573- tokens , _ = self ._tokens_for_completion (line , begidx , endidx )
1573+ tokens , _ = self .tokens_for_completion (line , begidx , endidx )
15741574 if not tokens :
15751575 return []
15761576
@@ -2607,7 +2607,7 @@ def complete_help_subcommand(self, text: str, line: str, begidx: int, endidx: in
26072607 """Completes the subcommand argument of help"""
26082608
26092609 # 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 )
26112611
26122612 if not tokens :
26132613 return []
0 commit comments