Skip to content

Commit b1a8048

Browse files
committed
fix tests and groups
1 parent 036560a commit b1a8048

7 files changed

Lines changed: 23 additions & 19 deletions

File tree

extensions/markdown/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
{
155155
"command": "markdown.showPreview",
156156
"when": "resourceLangId == markdown",
157-
"group": "2_navigation"
157+
"group": "navigation"
158158
}
159159
],
160160
"commandPalette": [

src/vs/platform/actions/test/common/menuService.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ suite('MenuService', function () {
151151

152152
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
153153

154-
assert.equal(groups.length, 1);
155-
const [[, actions]] = groups;
154+
assert.equal(groups.length, 2);
155+
const [, actions] = groups[1];
156156

157157
assert.equal(actions.length, 3);
158158
const [one, two, three] = actions;
@@ -188,8 +188,8 @@ suite('MenuService', function () {
188188

189189
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
190190

191-
assert.equal(groups.length, 1);
192-
const [[, actions]] = groups;
191+
assert.equal(groups.length, 2);
192+
const [, actions] = groups[1];
193193

194194
assert.equal(actions.length, 4);
195195
const [one, two, three, four] = actions;
@@ -225,7 +225,7 @@ suite('MenuService', function () {
225225
assert.equal(groups.length, 1);
226226
const [[, actions]] = groups;
227227

228-
assert.equal(actions.length, 3);
228+
assert.equal(actions.length, 5);
229229
const [one, two, three] = actions;
230230
assert.equal(one.id, 'c');
231231
assert.equal(two.id, 'b');

src/vs/workbench/parts/execution/electron-browser/execution.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ const openConsoleCommand = {
163163
};
164164

165165
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
166-
group: '2_navigation',
166+
group: 'navigation',
167167
order: 30,
168168
command: openConsoleCommand,
169169
when: ResourceContextKey.Scheme.isEqualTo('file')
170170
});
171171

172172
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
173-
group: '2_navigation',
173+
group: 'navigation',
174174
order: 30,
175175
command: openConsoleCommand,
176176
when: ResourceContextKey.Scheme.isEqualTo('file')

src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function appendSaveConflictEditorTitleAction(id: string, title: string, iconClas
130130
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
131131
command: { id, title, iconClass },
132132
when: ContextKeyExpr.equals(CONFLICT_RESOLUTION_CONTEXT, true),
133-
group: '2_navigation',
133+
group: 'navigation',
134134
order
135135
});
136136
}
@@ -142,7 +142,7 @@ const openToSideCommand = {
142142
title: nls.localize('openToSide', "Open to the Side")
143143
};
144144
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
145-
group: '2_navigation',
145+
group: 'navigation',
146146
order: 10,
147147
command: openToSideCommand,
148148
when: ResourceContextKey.HasResource
@@ -153,7 +153,7 @@ const revealInOsCommand = {
153153
title: isWindows ? nls.localize('revealInWindows', "Reveal in Explorer") : isMacintosh ? nls.localize('revealInMac', "Reveal in Finder") : nls.localize('openContainer', "Open Containing Folder")
154154
};
155155
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
156-
group: '2_navigation',
156+
group: 'navigation',
157157
order: 20,
158158
command: revealInOsCommand,
159159
when: ResourceContextKey.Scheme.isEqualTo('file')
@@ -164,7 +164,7 @@ const copyPathCommand = {
164164
title: nls.localize('copyPath', "Copy Path")
165165
};
166166
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
167-
group: '2_navigation',
167+
group: 'navigation',
168168
order: 40,
169169
command: copyPathCommand,
170170
when: ResourceContextKey.HasResource
@@ -281,7 +281,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
281281
// Menu registration - explorer
282282

283283
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
284-
group: '1_new',
284+
group: 'navigation',
285285
order: 4,
286286
command: {
287287
id: NEW_FILE_COMMAND_ID,
@@ -291,7 +291,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
291291
});
292292

293293
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
294-
group: '1_new',
294+
group: 'navigation',
295295
order: 6,
296296
command: {
297297
id: NEW_FOLDER_COMMAND_ID,
@@ -301,14 +301,14 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
301301
});
302302

303303
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
304-
group: '2_navigation',
304+
group: 'navigation',
305305
order: 10,
306306
command: openToSideCommand,
307307
when: ContextKeyExpr.and(ResourceContextKey.Scheme.isEqualTo('file'), ExplorerFolderContext.toNegated())
308308
});
309309

310310
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
311-
group: '2_navigation',
311+
group: 'navigation',
312312
order: 20,
313313
command: revealInOsCommand,
314314
when: ResourceContextKey.HasResource

src/vs/workbench/parts/search/electron-browser/search.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ CommandsRegistry.registerCommand({
220220
});
221221

222222
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
223-
group: '2_navigation',
223+
group: 'navigation',
224224
order: 50,
225225
command: {
226226
id: FIND_IN_FOLDER_ID,
@@ -230,7 +230,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
230230
});
231231

232232
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
233-
group: '2_navigation',
233+
group: 'navigation',
234234
order: 20,
235235
command: {
236236
id: FIND_IN_WORKSPACE_ID,

src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ import { IModeService } from 'vs/editor/common/services/modeService';
3737
import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
3838
import { IModelService } from 'vs/editor/common/services/modelService';
3939
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
40-
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
40+
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
4141
import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing';
4242
import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding';
4343
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';
4444
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
4545
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
4646
import { mkdirp } from 'vs/base/node/pfs';
47+
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
4748

4849
interface Modifiers {
4950
metaKey?: boolean;
@@ -73,6 +74,7 @@ suite('Keybindings Editing', () => {
7374
instantiationService.stub(IWorkspaceContextService, new TestContextService());
7475
const lifecycleService = new TestLifecycleService();
7576
instantiationService.stub(ILifecycleService, lifecycleService);
77+
instantiationService.stub(IContextKeyService, <IContextKeyService>instantiationService.createInstance(MockContextKeyService));
7678
instantiationService.stub(IHashService, new TestHashService());
7779
instantiationService.stub(IEditorGroupService, new TestEditorGroupService());
7880
instantiationService.stub(ITelemetryService, NullTelemetryService);

src/vs/workbench/test/workbenchTestServices.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import { IPosition, Position as EditorPosition } from 'vs/editor/common/core/pos
6060
import { ICommandAction } from 'vs/platform/actions/common/actions';
6161
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
6262
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
63+
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
6364

6465
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
6566
return instantiationService.createInstance(FileEditorInput, resource, void 0);
@@ -236,6 +237,7 @@ export class TestTextFileService extends TextFileService {
236237

237238
export function workbenchInstantiationService(): IInstantiationService {
238239
let instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()]));
240+
instantiationService.stub(IContextKeyService, <IContextKeyService>instantiationService.createInstance(MockContextKeyService));
239241
instantiationService.stub(IWorkspaceContextService, new TestContextService(TestWorkspace));
240242
const configService = new TestConfigurationService();
241243
instantiationService.stub(IConfigurationService, configService);

0 commit comments

Comments
 (0)