mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Make identifier computed to better support task customization
This commit is contained in:
@@ -316,7 +316,7 @@ namespace Tasks {
|
||||
detail: extension.id
|
||||
},
|
||||
name: task.name,
|
||||
identifier: task.identifier,
|
||||
identifier: task.identifier ? task.identifier : `${extension.id}.${task.name}`,
|
||||
group: types.TaskGroup.is(task.group) ? task.group : undefined,
|
||||
command: command,
|
||||
isBackground: !!task.isBackground,
|
||||
|
||||
@@ -1030,7 +1030,6 @@ export class BaseTask {
|
||||
throw illegalArgument('name');
|
||||
}
|
||||
this._name = name;
|
||||
this._identifier = name;
|
||||
this._problemMatchers = problemMatchers || [];
|
||||
this._isBackground = false;
|
||||
this._terminal = Object.create(null);
|
||||
@@ -1041,11 +1040,11 @@ export class BaseTask {
|
||||
}
|
||||
|
||||
set identifier(value: string) {
|
||||
if (typeof value !== 'string') {
|
||||
throw illegalArgument('identifier');
|
||||
if (value === void 0 || value === null) {
|
||||
this._identifier = undefined;
|
||||
}
|
||||
if (value.indexOf(':') !== -1) {
|
||||
throw illegalArgument('identifier must not contain \':\'');
|
||||
if (typeof value !== 'string' || value.length === 0) {
|
||||
throw illegalArgument('identifier must be a string of length > 0');
|
||||
}
|
||||
this._identifier = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user