fix tests and groups

This commit is contained in:
isidor
2017-12-27 17:50:31 +01:00
parent 036560ad9a
commit b1a8048c19
7 changed files with 23 additions and 19 deletions

View File

@@ -154,7 +154,7 @@
{
"command": "markdown.showPreview",
"when": "resourceLangId == markdown",
"group": "2_navigation"
"group": "navigation"
}
],
"commandPalette": [

View File

@@ -151,8 +151,8 @@ suite('MenuService', function () {
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
assert.equal(groups.length, 1);
const [[, actions]] = groups;
assert.equal(groups.length, 2);
const [, actions] = groups[1];
assert.equal(actions.length, 3);
const [one, two, three] = actions;
@@ -188,8 +188,8 @@ suite('MenuService', function () {
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
assert.equal(groups.length, 1);
const [[, actions]] = groups;
assert.equal(groups.length, 2);
const [, actions] = groups[1];
assert.equal(actions.length, 4);
const [one, two, three, four] = actions;
@@ -225,7 +225,7 @@ suite('MenuService', function () {
assert.equal(groups.length, 1);
const [[, actions]] = groups;
assert.equal(actions.length, 3);
assert.equal(actions.length, 5);
const [one, two, three] = actions;
assert.equal(one.id, 'c');
assert.equal(two.id, 'b');

View File

@@ -163,14 +163,14 @@ const openConsoleCommand = {
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '2_navigation',
group: 'navigation',
order: 30,
command: openConsoleCommand,
when: ResourceContextKey.Scheme.isEqualTo('file')
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '2_navigation',
group: 'navigation',
order: 30,
command: openConsoleCommand,
when: ResourceContextKey.Scheme.isEqualTo('file')

View File

@@ -130,7 +130,7 @@ function appendSaveConflictEditorTitleAction(id: string, title: string, iconClas
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: { id, title, iconClass },
when: ContextKeyExpr.equals(CONFLICT_RESOLUTION_CONTEXT, true),
group: '2_navigation',
group: 'navigation',
order
});
}
@@ -142,7 +142,7 @@ const openToSideCommand = {
title: nls.localize('openToSide', "Open to the Side")
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '2_navigation',
group: 'navigation',
order: 10,
command: openToSideCommand,
when: ResourceContextKey.HasResource
@@ -153,7 +153,7 @@ const revealInOsCommand = {
title: isWindows ? nls.localize('revealInWindows', "Reveal in Explorer") : isMacintosh ? nls.localize('revealInMac', "Reveal in Finder") : nls.localize('openContainer', "Open Containing Folder")
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '2_navigation',
group: 'navigation',
order: 20,
command: revealInOsCommand,
when: ResourceContextKey.Scheme.isEqualTo('file')
@@ -164,7 +164,7 @@ const copyPathCommand = {
title: nls.localize('copyPath', "Copy Path")
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '2_navigation',
group: 'navigation',
order: 40,
command: copyPathCommand,
when: ResourceContextKey.HasResource
@@ -281,7 +281,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
// Menu registration - explorer
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '1_new',
group: 'navigation',
order: 4,
command: {
id: NEW_FILE_COMMAND_ID,
@@ -291,7 +291,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '1_new',
group: 'navigation',
order: 6,
command: {
id: NEW_FOLDER_COMMAND_ID,
@@ -301,14 +301,14 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '2_navigation',
group: 'navigation',
order: 10,
command: openToSideCommand,
when: ContextKeyExpr.and(ResourceContextKey.Scheme.isEqualTo('file'), ExplorerFolderContext.toNegated())
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '2_navigation',
group: 'navigation',
order: 20,
command: revealInOsCommand,
when: ResourceContextKey.HasResource

View File

@@ -220,7 +220,7 @@ CommandsRegistry.registerCommand({
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '2_navigation',
group: 'navigation',
order: 50,
command: {
id: FIND_IN_FOLDER_ID,
@@ -230,7 +230,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '2_navigation',
group: 'navigation',
order: 20,
command: {
id: FIND_IN_WORKSPACE_ID,

View File

@@ -37,13 +37,14 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
import { IModelService } from 'vs/editor/common/services/modelService';
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing';
import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding';
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { mkdirp } from 'vs/base/node/pfs';
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
interface Modifiers {
metaKey?: boolean;
@@ -73,6 +74,7 @@ suite('Keybindings Editing', () => {
instantiationService.stub(IWorkspaceContextService, new TestContextService());
const lifecycleService = new TestLifecycleService();
instantiationService.stub(ILifecycleService, lifecycleService);
instantiationService.stub(IContextKeyService, <IContextKeyService>instantiationService.createInstance(MockContextKeyService));
instantiationService.stub(IHashService, new TestHashService());
instantiationService.stub(IEditorGroupService, new TestEditorGroupService());
instantiationService.stub(ITelemetryService, NullTelemetryService);

View File

@@ -60,6 +60,7 @@ import { IPosition, Position as EditorPosition } from 'vs/editor/common/core/pos
import { ICommandAction } from 'vs/platform/actions/common/actions';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
return instantiationService.createInstance(FileEditorInput, resource, void 0);
@@ -236,6 +237,7 @@ export class TestTextFileService extends TextFileService {
export function workbenchInstantiationService(): IInstantiationService {
let instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()]));
instantiationService.stub(IContextKeyService, <IContextKeyService>instantiationService.createInstance(MockContextKeyService));
instantiationService.stub(IWorkspaceContextService, new TestContextService(TestWorkspace));
const configService = new TestConfigurationService();
instantiationService.stub(IConfigurationService, configService);