MCPcopy
hub / github.com/cli/cli / getRepoSuggestions

Function getRepoSuggestions

pkg/cmd/codespace/create.go:574–587  ·  view source on GitHub ↗
(ctx context.Context, apiClient apiClient, partialSearch string)

Source from the content-addressed store, hash-verified

572}
573
574func getRepoSuggestions(ctx context.Context, apiClient apiClient, partialSearch string) []string {
575 searchParams := api.RepoSearchParameters{
576 // The prompt shows 7 items so 7 effectively turns off scrolling which is similar behavior to other clients
577 MaxRepos: 7,
578 Sort: "repo",
579 }
580
581 repos, err := apiClient.GetCodespaceRepoSuggestions(ctx, partialSearch, searchParams)
582 if err != nil {
583 return nil
584 }
585
586 return repos
587}
588
589// buildDisplayName returns display name to be used in the machine survey prompt.
590// prebuildAvailability will be migrated to use enum values: "none", "ready", "in_progress" before Prebuild GA

Callers 1

CreateMethod · 0.85

Calls 1

Tested by

no test coverage detected