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

Function NewSpecialAssigneeReplacer

pkg/cmd/pr/shared/editable.go:197–203  ·  view source on GitHub ↗

NewSpecialAssigneeReplacer creates a replacer that expands @me and (when actorAssignees is true) Copilot actor names in assignee slices. copilotUseLogin controls whether Copilot actors are replaced with their login (true) or display name (false, used for web mode).

(client *api.Client, host string, actorAssignees bool, copilotUseLogin bool)

Source from the content-addressed store, hash-verified

195// copilotUseLogin controls whether Copilot actors are replaced with their
196// login (true) or display name (false, used for web mode).
197func NewSpecialAssigneeReplacer(client *api.Client, host string, actorAssignees bool, copilotUseLogin bool) *SpecialAssigneeReplacer {
198 return &SpecialAssigneeReplacer{
199 meReplacer: NewMeReplacer(client, host),
200 copilotReplacer: NewCopilotReplacer(copilotUseLogin),
201 actorAssignees: actorAssignees,
202 }
203}
204
205func (r *SpecialAssigneeReplacer) ReplaceSlice(logins []string) ([]string, error) {
206 replaced, err := r.meReplacer.ReplaceSlice(logins)

Callers 3

NewIssueStateFunction · 0.92
AssigneeIdsMethod · 0.85
AssigneeLoginsMethod · 0.85

Calls 2

NewMeReplacerFunction · 0.85
NewCopilotReplacerFunction · 0.85

Tested by

no test coverage detected