Skip to content

Commit 577cc41

Browse files
committed
remove unused method get_completions()
from main.py
1 parent 50c15a0 commit 577cc41

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Internal
5252
* Move special commands out of `main.py`.
5353
* Modernize orthography of prompt_toolkit filters.
5454
* Pin all GitHub Actions to hashes.
55+
* Remove unused method `get_completions()`.
5556

5657

5758
1.67.1 (2026/03/28)

mycli/main.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
from configobj import ConfigObj
3131
import keyring
3232
from prompt_toolkit import print_formatted_text
33-
from prompt_toolkit.completion import Completion
34-
from prompt_toolkit.document import Document
3533
from prompt_toolkit.formatted_text import (
3634
ANSI,
3735
HTML,
@@ -1033,10 +1031,6 @@ def _on_completions_refreshed(self, new_completer: SQLCompleter) -> None:
10331031
# "Refreshing completions..." indicator
10341032
self.prompt_session.app.invalidate()
10351033

1036-
def get_completions(self, text: str, cursor_position: int) -> Iterable[Completion]:
1037-
with self._completer_lock:
1038-
return self.completer.get_completions(Document(text=text, cursor_position=cursor_position), None)
1039-
10401034
def run_query(
10411035
self,
10421036
query: str,

test/pytests/test_main.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,15 +2236,6 @@ def test_on_completions_refreshed_updates_completer_and_invalidates_prompt() ->
22362236
assert entered_lock['count'] == 1
22372237

22382238

2239-
def test_get_completions_uses_current_completer() -> None:
2240-
cli = make_bare_mycli()
2241-
entered_lock = {'count': 0}
2242-
cli._completer_lock = cast(Any, ReusableLock(lambda: entered_lock.__setitem__('count', entered_lock['count'] + 1)))
2243-
cli.completer = cast(Any, SimpleNamespace(get_completions=lambda document, event: ['done']))
2244-
assert list(main.MyCli.get_completions(cli, 'select', 6)) == ['done']
2245-
assert entered_lock['count'] == 1
2246-
2247-
22482239
def test_click_entrypoint_callback_covers_dsn_list_init_commands(monkeypatch: pytest.MonkeyPatch) -> None:
22492240
dummy_class = make_dummy_mycli_class(
22502241
config={

0 commit comments

Comments
 (0)