Skip to content

Commit ed48c7b

Browse files
authored
add create temp profile action to create picker (microsoft#161810)
1 parent 29e985e commit ed48c7b

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,31 +141,38 @@ registerAction2(class CreateProfileAction extends Action2 {
141141
}, {
142142
id: CreateEmptyProfileAction.ID,
143143
label: CreateEmptyProfileAction.TITLE.value,
144+
}, {
145+
id: CreateTransientProfileAction.ID,
146+
label: CreateTransientProfileAction.TITLE.value,
144147
}], { hideInput: true, canPickMany: false, title: localize('create settings profile', "{0}: Create...", PROFILES_CATEGORY) });
145148
if (pick) {
146149
return commandService.executeCommand(pick.id);
147150
}
148151
}
149152
});
150153

151-
registerAction2(class CreateTransientProfileAction extends Action2 {
154+
class CreateTransientProfileAction extends Action2 {
155+
static readonly ID = 'workbench.profiles.actions.createTemporaryProfile';
156+
static readonly TITLE = {
157+
value: localize('create temporary profile', "Create a Temporary Settings Profile"),
158+
original: 'Create a Temporary Settings Profile'
159+
};
152160
constructor() {
153161
super({
154-
id: 'workbench.profiles.actions.createTemporaryProfile',
155-
title: {
156-
value: localize('create temporary profile', "Create a Temporary Settings Profile"),
157-
original: 'Create a Temporary Settings Profile'
158-
},
162+
id: CreateTransientProfileAction.ID,
163+
title: CreateTransientProfileAction.TITLE,
159164
category: PROFILES_CATEGORY,
160165
f1: true,
161-
precondition: PROFILES_ENABLEMENT_CONTEXT
166+
precondition: PROFILES_ENABLEMENT_CONTEXT,
162167
});
163168
}
164169

165170
async run(accessor: ServicesAccessor) {
166171
return accessor.get(IUserDataProfileManagementService).createAndEnterTransientProfile();
167172
}
168-
});
173+
}
174+
175+
registerAction2(CreateTransientProfileAction);
169176

170177
export class RenameProfileAction extends Action2 {
171178
static readonly ID = 'workbench.profiles.actions.renameProfile';

0 commit comments

Comments
 (0)