makeAgentName attempts to create an agent name. It will first attempt to create an agent name based off of the workspace folder, and will eventually fallback to a friendly name. Like `safeAgentName`, the second returned value will be true if the agent name utilizes the workspace folder, and false if
(workspaceFolder string, friendlyName string)
| 1143 | // agent name utilizes the workspace folder, and false if it falls back to the |
| 1144 | // friendly name. |
| 1145 | func (api *API) makeAgentName(workspaceFolder string, friendlyName string) (string, bool) { |
| 1146 | for attempt := 0; attempt <= maxAttemptsToNameAgent; attempt++ { |
| 1147 | agentName, usingWorkspaceFolder := expandedAgentName(workspaceFolder, friendlyName, attempt) |
| 1148 | if !usingWorkspaceFolder { |
| 1149 | return agentName, false |
| 1150 | } |
| 1151 | |
| 1152 | if !api.devcontainerNames[agentName] { |
| 1153 | return agentName, true |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | return safeFriendlyName(friendlyName), false |
| 1158 | } |
| 1159 | |
| 1160 | // RefreshContainers triggers an immediate update of the container list |
| 1161 | // and waits for it to complete. |
no test coverage detected