diff --git a/typer/core.py b/typer/core.py index d98ece5c7e..27db7c72c3 100644 --- a/typer/core.py +++ b/typer/core.py @@ -62,7 +62,7 @@ def _typer_param_setup_autocompletion_compat( Callable[[click.Context, List[str], str], List[Union[Tuple[str, str], str]]] ] = None, ) -> None: - if autocompletion is None and self._custom_shell_complete is not None: + if self._custom_shell_complete is not None: import warnings warnings.warn( @@ -72,6 +72,8 @@ def _typer_param_setup_autocompletion_compat( stacklevel=2, ) + if autocompletion is not None: + def compat_autocompletion( ctx: click.Context, param: click.core.Parameter, incomplete: str ) -> List["click.shell_completion.CompletionItem"]: