Skip to content

Commit c573461

Browse files
committed
sort tasks
1 parent e799210 commit c573461

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Extension/src/Debugger/configurationProvider.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
6464
configuration: vscode.DebugConfiguration;
6565
}
6666

67+
// Find the recently used task and place it at the top of quickpick list.
68+
let recentlyUsedConfig: vscode.DebugConfiguration | undefined;
69+
configs = configs.filter(config => {
70+
if (config.detail !== TaskConfigStatus.recentlyUsed) {
71+
return true;
72+
} else {
73+
recentlyUsedConfig = config;
74+
return false;
75+
}
76+
});
77+
if (recentlyUsedConfig) {
78+
configs.unshift(recentlyUsedConfig);
79+
}
80+
6781
const items: MenuItem[] = configs.map<MenuItem>(config => {
6882
const reducedConfig: vscode.DebugConfiguration = {...config};
6983
// Remove the "detail" property from the DebugConfiguration that will be written in launch.json.
@@ -355,7 +369,6 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
355369
});
356370
}));
357371
configs.push(defaultConfig);
358-
// Sort tasks.
359372
return configs;
360373
}
361374

0 commit comments

Comments
 (0)