Skip to content

Commit 52e8de7

Browse files
committed
More task ID fixing
1 parent 200da72 commit 52e8de7

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/vs/workbench/contrib/tasks/common/taskConfiguration.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,12 +2080,13 @@ class ConfigurationParser {
20802080
}
20812081

20822082
let uuidMaps: Map<TaskConfigSource, Map<string, UUIDMap>> = new Map();
2083-
let recentUuidMaps: Map<string, UUIDMap> = new Map();
2083+
let recentUuidMaps: Map<TaskConfigSource, Map<string, UUIDMap>> = new Map();
20842084
export function parse(workspaceFolder: IWorkspaceFolder, workspace: IWorkspace | undefined, platform: Platform, configuration: ExternalTaskRunnerConfiguration, logger: IProblemReporter, source: TaskConfigSource, isRecents: boolean = false): ParseResult {
2085-
let selectedUuidMaps = isRecents ? recentUuidMaps : uuidMaps.get(source);
2085+
let recentOrOtherMaps = isRecents ? recentUuidMaps : uuidMaps;
2086+
let selectedUuidMaps = recentOrOtherMaps.get(source);
20862087
if (!selectedUuidMaps) {
2087-
uuidMaps.set(source, new Map());
2088-
selectedUuidMaps = uuidMaps.get(source)!;
2088+
recentOrOtherMaps.set(source, new Map());
2089+
selectedUuidMaps = recentOrOtherMaps.get(source)!;
20892090
}
20902091
let uuidMap = selectedUuidMaps.get(workspaceFolder.uri.toString());
20912092
if (!uuidMap) {

src/vs/workbench/contrib/tasks/common/tasks.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ export class CustomTask extends CommonTask {
725725

726726
public getMapKey(): string {
727727
let workspaceFolder = this._source.config.workspaceFolder;
728-
return workspaceFolder ? `${workspaceFolder.uri.toString()}|${this._id}` : this._id;
728+
return workspaceFolder ? `${workspaceFolder.uri.toString()}|${this._id}|${this.instance}` : `${this._id}|${this.instance}`;
729729
}
730730

731731
public getRecentlyUsedKey(): string | undefined {
@@ -843,8 +843,8 @@ export class ContributedTask extends CommonTask {
843843
public getMapKey(): string {
844844
let workspaceFolder = this._source.workspaceFolder;
845845
return workspaceFolder
846-
? `${this._source.scope.toString()}|${workspaceFolder.uri.toString()}|${this._id}`
847-
: `${this._source.scope.toString()}|${this._id}`;
846+
? `${this._source.scope.toString()}|${workspaceFolder.uri.toString()}|${this._id}|${this.instance}`
847+
: `${this._source.scope.toString()}|${this._id}|${this.instance}`;
848848
}
849849

850850
public getRecentlyUsedKey(): string | undefined {
@@ -899,6 +899,10 @@ export class InMemoryTask extends CommonTask {
899899
return 'composite';
900900
}
901901

902+
public getMapKey(): string {
903+
return `${this._id}|${this.instance}`;
904+
}
905+
902906
protected fromObject(object: InMemoryTask): InMemoryTask {
903907
return new InMemoryTask(object._id, object._source, object._label, object.type, object.runOptions, object.configurationProperties);
904908
}

0 commit comments

Comments
 (0)