提交 52e8de79 编写于 作者: A Alex Ross

More task ID fixing

上级 200da727
...@@ -2080,12 +2080,13 @@ class ConfigurationParser { ...@@ -2080,12 +2080,13 @@ class ConfigurationParser {
} }
let uuidMaps: Map<TaskConfigSource, Map<string, UUIDMap>> = new Map(); let uuidMaps: Map<TaskConfigSource, Map<string, UUIDMap>> = new Map();
let recentUuidMaps: Map<string, UUIDMap> = new Map(); let recentUuidMaps: Map<TaskConfigSource, Map<string, UUIDMap>> = new Map();
export function parse(workspaceFolder: IWorkspaceFolder, workspace: IWorkspace | undefined, platform: Platform, configuration: ExternalTaskRunnerConfiguration, logger: IProblemReporter, source: TaskConfigSource, isRecents: boolean = false): ParseResult { 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) { if (!selectedUuidMaps) {
uuidMaps.set(source, new Map()); recentOrOtherMaps.set(source, new Map());
selectedUuidMaps = uuidMaps.get(source)!; selectedUuidMaps = recentOrOtherMaps.get(source)!;
} }
let uuidMap = selectedUuidMaps.get(workspaceFolder.uri.toString()); let uuidMap = selectedUuidMaps.get(workspaceFolder.uri.toString());
if (!uuidMap) { if (!uuidMap) {
......
...@@ -725,7 +725,7 @@ export class CustomTask extends CommonTask { ...@@ -725,7 +725,7 @@ export class CustomTask extends CommonTask {
public getMapKey(): string { public getMapKey(): string {
let workspaceFolder = this._source.config.workspaceFolder; 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 { public getRecentlyUsedKey(): string | undefined {
...@@ -843,8 +843,8 @@ export class ContributedTask extends CommonTask { ...@@ -843,8 +843,8 @@ export class ContributedTask extends CommonTask {
public getMapKey(): string { public getMapKey(): string {
let workspaceFolder = this._source.workspaceFolder; let workspaceFolder = this._source.workspaceFolder;
return workspaceFolder return workspaceFolder
? `${this._source.scope.toString()}|${workspaceFolder.uri.toString()}|${this._id}` ? `${this._source.scope.toString()}|${workspaceFolder.uri.toString()}|${this._id}|${this.instance}`
: `${this._source.scope.toString()}|${this._id}`; : `${this._source.scope.toString()}|${this._id}|${this.instance}`;
} }
public getRecentlyUsedKey(): string | undefined { public getRecentlyUsedKey(): string | undefined {
...@@ -899,6 +899,10 @@ export class InMemoryTask extends CommonTask { ...@@ -899,6 +899,10 @@ export class InMemoryTask extends CommonTask {
return 'composite'; return 'composite';
} }
public getMapKey(): string {
return `${this._id}|${this.instance}`;
}
protected fromObject(object: InMemoryTask): InMemoryTask { protected fromObject(object: InMemoryTask): InMemoryTask {
return new InMemoryTask(object._id, object._source, object._label, object.type, object.runOptions, object.configurationProperties); return new InMemoryTask(object._id, object._source, object._label, object.type, object.runOptions, object.configurationProperties);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册