Skip to content

Commit

Permalink
Merge pull request #13827 from krassowski/improve-completer-docs
Browse files Browse the repository at this point in the history
Explain expected format for `disable_matchers`/identifiers
  • Loading branch information
Carreau committed Nov 16, 2022
2 parents cfe9e34 + c5994ee commit fb2642c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 10 additions & 3 deletions IPython/core/completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,10 @@ def completion_matcher(
identifier : Optional[str]
identifier of the matcher allowing users to modify the behaviour via traitlets,
and also used to for debugging (will be passed as ``origin`` with the completions).
Defaults to matcher function ``__qualname__``.
Defaults to matcher function's ``__qualname__`` (for example,
``IPCompleter.file_matcher`` for the built-in matched defined
as a ``file_matcher`` method of the ``IPCompleter`` class).
api_version: Optional[int]
version of the Matcher API used by this matcher.
Currently supported values are 1 and 2.
Expand Down Expand Up @@ -1460,14 +1463,18 @@ def _greedy_changed(self, change):
If False, only the completion results from the first non-empty
completer will be returned.
As of version 8.6.0, setting the value to ``False`` is an alias for:
``IPCompleter.suppress_competing_matchers = True.``.
""",
).tag(config=True)

disable_matchers = ListTrait(
Unicode(), help="""List of matchers to disable."""
Unicode(),
help="""List of matchers to disable.
The list should contain matcher identifiers (see :any:`completion_matcher`).
""",
).tag(config=True)

omit__names = Enum(
Expand Down
2 changes: 2 additions & 0 deletions IPython/core/magics/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def config(self, s):
Current: False
IPCompleter.disable_matchers=<list-item-1>...
List of matchers to disable.
The list should contain matcher identifiers (see
:any:`completion_matcher`).
Current: []
IPCompleter.greedy=<Bool>
Activate greedy completion
Expand Down

0 comments on commit fb2642c

Please sign in to comment.