diff --git a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts index e2256e70dfff54acb67bbbc923593b0f4ce4ae81..eb5b719dfeb2789cfb62776a25fcbb0a27d23d7d 100644 --- a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts +++ b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts @@ -2080,12 +2080,13 @@ class ConfigurationParser { } let uuidMaps: Map> = new Map(); -let recentUuidMaps: Map = new Map(); +let recentUuidMaps: Map> = new Map(); export function parse(workspaceFolder: IWorkspaceFolder, workspace: IWorkspace | undefined, platform: Platform, configuration: ExternalTaskRunnerConfiguration, logger: IProblemReporter, source: TaskConfigSource, isRecents: boolean = false): ParseResult { - let selectedUuidMaps = isRecents ? recentUuidMaps : uuidMaps.get(source); + let recentOrOtherMaps = isRecents ? recentUuidMaps : uuidMaps; + let selectedUuidMaps = recentOrOtherMaps.get(source); if (!selectedUuidMaps) { - uuidMaps.set(source, new Map()); - selectedUuidMaps = uuidMaps.get(source)!; + recentOrOtherMaps.set(source, new Map()); + selectedUuidMaps = recentOrOtherMaps.get(source)!; } let uuidMap = selectedUuidMaps.get(workspaceFolder.uri.toString()); if (!uuidMap) { diff --git a/src/vs/workbench/contrib/tasks/common/tasks.ts b/src/vs/workbench/contrib/tasks/common/tasks.ts index 5b075e505b8480a2f621b037d316cf3b236cd0b4..833f7e98eda5996d7c821bc2609b7159a7b64a96 100644 --- a/src/vs/workbench/contrib/tasks/common/tasks.ts +++ b/src/vs/workbench/contrib/tasks/common/tasks.ts @@ -725,7 +725,7 @@ export class CustomTask extends CommonTask { public getMapKey(): string { let workspaceFolder = this._source.config.workspaceFolder; - return workspaceFolder ? `${workspaceFolder.uri.toString()}|${this._id}` : this._id; + return workspaceFolder ? `${workspaceFolder.uri.toString()}|${this._id}|${this.instance}` : `${this._id}|${this.instance}`; } public getRecentlyUsedKey(): string | undefined { @@ -843,8 +843,8 @@ export class ContributedTask extends CommonTask { public getMapKey(): string { let workspaceFolder = this._source.workspaceFolder; return workspaceFolder - ? `${this._source.scope.toString()}|${workspaceFolder.uri.toString()}|${this._id}` - : `${this._source.scope.toString()}|${this._id}`; + ? `${this._source.scope.toString()}|${workspaceFolder.uri.toString()}|${this._id}|${this.instance}` + : `${this._source.scope.toString()}|${this._id}|${this.instance}`; } public getRecentlyUsedKey(): string | undefined { @@ -899,6 +899,10 @@ export class InMemoryTask extends CommonTask { return 'composite'; } + public getMapKey(): string { + return `${this._id}|${this.instance}`; + } + protected fromObject(object: InMemoryTask): InMemoryTask { return new InMemoryTask(object._id, object._source, object._label, object.type, object.runOptions, object.configurationProperties); }