356
357
async createTransientProfile(workspaceIdentifier?: IAnyWorkspaceIdentifier): Promise<IUserDataProfile> {
359
>
const nameRegEx = new RegExp(`${escapeRegExpCharacters(namePrefix)}\\s(\\d+)`);
360
>
let nameIndex = 0;
361
>
for (const profile of this.profiles) {
362
>
const matches = nameRegEx.exec(profile.name);
363
>
const index = matches ? parseInt(matches[1]) : 0;
364
>
nameIndex = index > nameIndex ? index : nameIndex;
365
>
}
366
>
const name = `${namePrefix} ${nameIndex + 1}`;
367
>
return this.createProfile(hash(generateUuid()).toString(16), name, { transient: true }, workspaceIdentifier);
368
>
}
369
370
async createNamedProfile(name: string, options?: IUserDataProfileOptions, workspaceIdentifier?: IAnyWorkspaceIdentifier): Promise<IUserDataProfile> {