MCPcopy Create free account
hub / github.com/cli/cli / getRepoSuggestions

Function getRepoSuggestions

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

Source from the content-addressed store, hash-verified

577}
578
579func getRepoSuggestions(ctx context.Context, apiClient apiClient, partialSearch string) []string {
580 searchParams := api.RepoSearchParameters{
581 // The prompt shows 7 items so 7 effectively turns off scrolling which is similar behavior to other clients
582 MaxRepos: 7,
583 Sort: "repo",
584 }
585
586 repos, err := apiClient.GetCodespaceRepoSuggestions(ctx, partialSearch, searchParams)
587 if err != nil {
588 return nil
589 }
590
591 return repos
592}
593
594// buildDisplayName returns display name to be used in the machine survey prompt.
595// 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