Skip to content

Commit dcc3158

Browse files
committed
chore(repo completions): Add annotations
1 parent 098516f commit dcc3158

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

vcspull/cli/sync.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import click
66
import click.shell_completion
7+
from click.shell_completion import CompletionItem
78

89
from libvcs.shortcuts import create_project_from_pip_url
910

@@ -12,7 +13,9 @@
1213
log = logging.getLogger(__name__)
1314

1415

15-
def get_repo_completions(ctx: click.core.Context, args, incomplete):
16+
def get_repo_completions(
17+
ctx: click.Context, param: click.Parameter, incomplete: str
18+
) -> list[CompletionItem]:
1619
configs = (
1720
load_configs(find_config_files(include_home=True))
1821
if ctx.params["config"] is None
@@ -35,7 +38,11 @@ def get_repo_completions(ctx: click.core.Context, args, incomplete):
3538
if len(found_repos) == 0:
3639
found_repos = configs
3740

38-
return [o["name"] for o in found_repos if o["name"].startswith(incomplete)]
41+
return [
42+
CompletionItem(o["name"])
43+
for o in found_repos
44+
if o["name"].startswith(incomplete)
45+
]
3946

4047

4148
def get_config_file_completions(ctx, args, incomplete):

0 commit comments

Comments
 (0)