提交 f0e5bab3 编写于 作者: A Alex Ross

tasks.json not refreshed

Fixes #93691
上级 45a4b126
......@@ -107,11 +107,14 @@ export class TaskQuickPick extends Disposable {
const workspaceFolder = configuredTasks[j].getWorkspaceFolder()?.uri.toString();
const definition = configuredTasks[j].getDefinition()?._key;
const recentKey = configuredTasks[j].getRecentlyUsedKey();
if (!recentTasks.find((value) => {
const findIndex = recentTasks.findIndex((value) => {
return (workspaceFolder && definition && value.getWorkspaceFolder()?.uri.toString() === workspaceFolder && value.getDefinition()?._key === definition)
|| (recentKey && value.getRecentlyUsedKey() === recentKey);
})) {
});
if (findIndex === -1) {
dedupedConfiguredTasks.push(configuredTasks[j]);
} else {
recentTasks[findIndex] = configuredTasks[j];
}
}
dedupedConfiguredTasks = dedupedConfiguredTasks.sort((a, b) => this.sorter.compare(a, b));
......@@ -126,11 +129,12 @@ export class TaskQuickPick extends Disposable {
const configuredTasks: (Task | ConfiguringTask)[] = this.handleFolderTaskResult(await this.taskService.getWorkspaceTasks());
const extensionTaskTypes = this.taskService.taskTypes();
this.topLevelEntries = [];
// Dedupe will update recent tasks if they've changed in tasks.json.
let dedupedConfiguredTasks: (Task | ConfiguringTask)[] = this.dedupeConfiguredAndRecent(recentTasks, configuredTasks);
if (recentTasks.length > 0) {
this.createEntriesForGroup(this.topLevelEntries, recentTasks, nls.localize('recentlyUsed', 'recently used'));
}
if (configuredTasks.length > 0) {
let dedupedConfiguredTasks: (Task | ConfiguringTask)[] = this.dedupeConfiguredAndRecent(recentTasks, configuredTasks);
if (dedupedConfiguredTasks.length > 0) {
this.createEntriesForGroup(this.topLevelEntries, dedupedConfiguredTasks, nls.localize('configured', 'configured'));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册