Show More
@@ -754,7 +754,7 b' def get__all__entries(obj):' | |||
|
754 | 754 | |
|
755 | 755 | |
|
756 | 756 | def match_dict_keys(keys: List[Union[str, bytes, Tuple[Union[str, bytes]]]], prefix: str, delims: str, |
|
757 |
prefix |
|
|
757 | extra_prefix: Optional[Tuple[str, bytes]]=None) -> Tuple[str, int, List[str]]: | |
|
758 | 758 | """Used by dict_key_matches, matching the prefix to a list of keys |
|
759 | 759 | |
|
760 | 760 | Parameters |
@@ -765,7 +765,7 b' def match_dict_keys(keys: List[Union[str, bytes, Tuple[Union[str, bytes]]]], pre' | |||
|
765 | 765 | Part of the text already typed by the user. E.g. `mydict[b'fo` |
|
766 | 766 | delims: |
|
767 | 767 | String of delimiters to consider when finding the current key. |
|
768 |
prefix |
|
|
768 | extra_prefix: optional | |
|
769 | 769 | Part of the text already typed in multi-key index cases. E.g. for |
|
770 | 770 | `mydict['foo', "bar", 'b`, this would be `('foo', 'bar')`. |
|
771 | 771 | |
@@ -778,6 +778,7 b' def match_dict_keys(keys: List[Union[str, bytes, Tuple[Union[str, bytes]]]], pre' | |||
|
778 | 778 | ``matches`` a list of replacement/completion |
|
779 | 779 | |
|
780 | 780 | """ |
|
781 | prefix_tuple = extra_prefix if extra_prefix else () | |
|
781 | 782 | Nprefix = len(prefix_tuple) |
|
782 | 783 | def filter_by_prefix_tuple(key): |
|
783 | 784 | if len(key) < Nprefix: |
@@ -1708,12 +1709,9 b' class IPCompleter(Completer):' | |||
|
1708 | 1709 | if not keys: |
|
1709 | 1710 | return keys |
|
1710 | 1711 | |
|
1711 | if prefix0 != '': | |
|
1712 | tuple_prefix = eval(prefix0) | |
|
1713 | else: | |
|
1714 | tuple_prefix = tuple() | |
|
1712 | extra_prefix = eval(prefix0) if prefix0 != '' else None | |
|
1715 | 1713 | |
|
1716 |
closing_quote, token_offset, matches = match_dict_keys(keys, |
|
|
1714 | closing_quote, token_offset, matches = match_dict_keys(keys, prefix, self.splitter.delims, extra_prefix=extra_prefix) | |
|
1717 | 1715 | if not matches: |
|
1718 | 1716 | return matches |
|
1719 | 1717 |
General Comments 0
You need to be logged in to leave comments.
Login now