MCPcopy
hub / github.com/cli/cli / NewSpecialAssigneeReplacer

Function NewSpecialAssigneeReplacer

pkg/cmd/pr/shared/editable.go:196–202  ·  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

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