提交 4c59f44e 编写于 作者: D Dirk Baeumer

Fixes #29593: Tasks 2.0.0: presentation is not allowed as a global property

上级 d205f209
......@@ -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.'),
......
......@@ -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) : []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册