diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts index 46f012fd34e2d8ceef91c5d98259898cfef3486b..3e1f9f25cb8d642c64d278557412105c05aa00e9 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts @@ -120,7 +120,13 @@ const group: IJSONSchema = { } }, ], - enum: [{ kind: 'build', isDefault: true }, { kind: 'test', isDefault: true }, 'build', 'test', 'none', { kind: 'build', isDefault: false }, { kind: 'test', isDefault: false }], + enum: [ + { kind: 'build', isDefault: true }, + { kind: 'test', isDefault: true }, + 'build', + 'test', + 'none' + ], enumDescriptions: [ nls.localize('JsonSchema.tasks.group.defaultBuild', 'Marks the tasks as the default build task.'), nls.localize('JsonSchema.tasks.group.defaultTest', 'Marks the tasks as the default test task.'), diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 17969f69973fba1159bad4361a46451686c82af0..bdd54d407f842825b2f8188d79a8b7a3ac6b1425 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -978,8 +978,17 @@ class TaskService extends EventEmitter implements ITaskService { let value: IConfigurationValue = { key: undefined, value: undefined }; // We have a global task configuration if (index === -1) { - value.key = 'tasks.problemMatchers'; - value.value = [toCustomize]; + if (properties.problemMatcher !== void 0) { + fileConfig.problemMatcher = properties.problemMatcher; + value.key = 'tasks.problemMatchers'; + value.value = fileConfig.problemMatcher; + promise = this.configurationEditingService.writeConfiguration(ConfigurationTarget.WORKSPACE, value); + } else if (properties.group !== void 0) { + fileConfig.group = properties.group; + value.key = 'tasks.group'; + value.value = fileConfig.group; + promise = this.configurationEditingService.writeConfiguration(ConfigurationTarget.WORKSPACE, value); + } } else { if (!Array.isArray(fileConfig.tasks)) { fileConfig.tasks = []; @@ -991,9 +1000,12 @@ class TaskService extends EventEmitter implements ITaskService { } else { fileConfig.tasks[index] = toCustomize; } + promise = this.configurationEditingService.writeConfiguration(ConfigurationTarget.WORKSPACE, value); } - promise = this.configurationEditingService.writeConfiguration(ConfigurationTarget.WORKSPACE, value); }; + if (!promise) { + return TPromise.as(undefined); + } return promise.then(() => { let event: TaskCustomizationTelementryEvent = { properties: properties ? Object.getOwnPropertyNames(properties) : []