Extension of the completer class with IPython-specific features
| 991 | return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for p in completion.params) if f]) |
| 992 | |
| 993 | class IPCompleter(Completer): |
| 994 | """Extension of the completer class with IPython-specific features""" |
| 995 | |
| 996 | _names = None |
| 997 | |
| 998 | @observe('greedy') |
| 999 | def _greedy_changed(self, change): |
| 1000 | """update the splitter and readline delims when greedy is changed""" |
| 1001 | if change['new']: |
| 1002 | self.splitter.delims = GREEDY_DELIMS |
| 1003 | else: |
| 1004 | self.splitter.delims = DELIMS |
| 1005 | |
| 1006 | dict_keys_only = Bool(False, |
| 1007 | help="""Whether to show dict key matches only""") |
| 1008 | |
| 1009 | merge_completions = Bool(True, |
| 1010 | help="""Whether to merge completion results into a single list |
| 1011 | |
| 1012 | If False, only the completion results from the first non-empty |
| 1013 | completer will be returned. |
| 1014 | """ |
| 1015 | ).tag(config=True) |
| 1016 | omit__names = Enum((0,1,2), default_value=2, |
| 1017 | help="""Instruct the completer to omit private method names |
| 1018 | |
| 1019 | Specifically, when completing on ``object.<tab>``. |
| 1020 | |
| 1021 | When 2 [default]: all names that start with '_' will be excluded. |
| 1022 | |
| 1023 | When 1: all 'magic' names (``__foo__``) will be excluded. |
| 1024 | |
| 1025 | When 0: nothing will be excluded. |
| 1026 | """ |
| 1027 | ).tag(config=True) |
| 1028 | limit_to__all__ = Bool(False, |
| 1029 | help=""" |
| 1030 | DEPRECATED as of version 5.0. |
| 1031 | |
| 1032 | Instruct the completer to use __all__ for the completion |
| 1033 | |
| 1034 | Specifically, when completing on ``object.<tab>``. |
| 1035 | |
| 1036 | When True: only those names in obj.__all__ will be included. |
| 1037 | |
| 1038 | When False [default]: the __all__ attribute is ignored |
| 1039 | """, |
| 1040 | ).tag(config=True) |
| 1041 | |
| 1042 | @observe('limit_to__all__') |
| 1043 | def _limit_to_all_changed(self, change): |
| 1044 | warnings.warn('`IPython.core.IPCompleter.limit_to__all__` configuration ' |
| 1045 | 'value has been deprecated since IPython 5.0, will be made to have ' |
| 1046 | 'no effects and then removed in future version of IPython.', |
| 1047 | UserWarning) |
| 1048 | |
| 1049 | def __init__(self, shell=None, namespace=None, global_namespace=None, |
| 1050 | use_readline=_deprecation_readline_sentinel, config=None, **kwargs): |
no outgoing calls
no test coverage detected