diff --git a/changelog.md b/changelog.md index 203346f1..74d16069 100644 --- a/changelog.md +++ b/changelog.md @@ -52,6 +52,7 @@ Internal * Move special commands out of `main.py`. * Modernize orthography of prompt_toolkit filters. * Pin all GitHub Actions to hashes. +* Remove unused method `get_completions()`. 1.67.1 (2026/03/28) diff --git a/mycli/main.py b/mycli/main.py index 2d25fc62..ae6ca3c5 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -30,8 +30,6 @@ from configobj import ConfigObj import keyring from prompt_toolkit import print_formatted_text -from prompt_toolkit.completion import Completion -from prompt_toolkit.document import Document from prompt_toolkit.formatted_text import ( ANSI, HTML, @@ -1033,10 +1031,6 @@ def _on_completions_refreshed(self, new_completer: SQLCompleter) -> None: # "Refreshing completions..." indicator self.prompt_session.app.invalidate() - def get_completions(self, text: str, cursor_position: int) -> Iterable[Completion]: - with self._completer_lock: - return self.completer.get_completions(Document(text=text, cursor_position=cursor_position), None) - def run_query( self, query: str, diff --git a/test/pytests/test_main.py b/test/pytests/test_main.py index 3f511851..84019590 100644 --- a/test/pytests/test_main.py +++ b/test/pytests/test_main.py @@ -2236,15 +2236,6 @@ def test_on_completions_refreshed_updates_completer_and_invalidates_prompt() -> assert entered_lock['count'] == 1 -def test_get_completions_uses_current_completer() -> None: - cli = make_bare_mycli() - entered_lock = {'count': 0} - cli._completer_lock = cast(Any, ReusableLock(lambda: entered_lock.__setitem__('count', entered_lock['count'] + 1))) - cli.completer = cast(Any, SimpleNamespace(get_completions=lambda document, event: ['done'])) - assert list(main.MyCli.get_completions(cli, 'select', 6)) == ['done'] - assert entered_lock['count'] == 1 - - def test_click_entrypoint_callback_covers_dsn_list_init_commands(monkeypatch: pytest.MonkeyPatch) -> None: dummy_class = make_dummy_mycli_class( config={