Offer launch.json generation from the startup project picker
The one-time prompt is easy to miss, so the picker now ends with the same command, plus a solution picker. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
This commit is contained in:
+24
-9
@@ -23,17 +23,32 @@ async function pickStartupProject(): Promise<void> {
|
||||
: 'No solution found in the workspace.');
|
||||
return;
|
||||
}
|
||||
const picked = await vscode.window.showQuickPick(
|
||||
candidates.map(project => ({
|
||||
label: project.info.name,
|
||||
description: vscode.workspace.asRelativePath(project.info.fsPath, false),
|
||||
detail: project.info.platforms.length ? `Platforms: ${project.info.platforms.join(', ')}` : undefined,
|
||||
picked: project === model.startupProject,
|
||||
project,
|
||||
})),
|
||||
type Item = vscode.QuickPickItem & { project?: StartupProject; action?: () => Promise<void> };
|
||||
const items: Item[] = candidates.map(project => ({
|
||||
label: project.info.name,
|
||||
description: vscode.workspace.asRelativePath(project.info.fsPath, false),
|
||||
detail: project.info.platforms.length ? `Platforms: ${project.info.platforms.join(', ')}` : undefined,
|
||||
picked: project === model.startupProject,
|
||||
project,
|
||||
}));
|
||||
items.push(
|
||||
{ label: '', kind: vscode.QuickPickItemKind.Separator },
|
||||
{
|
||||
label: '$(json) Create launch.json and tasks.json entries',
|
||||
description: 'so F5 builds with the selected configuration',
|
||||
action: generateLaunchConfig,
|
||||
},
|
||||
{
|
||||
label: '$(file-submodule) Select solution',
|
||||
description: model.allSolutions.length > 1 ? `${model.allSolutions.length} found` : undefined,
|
||||
action: pickSolution,
|
||||
});
|
||||
const picked = await vscode.window.showQuickPick(items,
|
||||
{ title: `${model.activeSolution?.name}: startup project`, matchOnDescription: true });
|
||||
if (picked) {
|
||||
if (picked?.project) {
|
||||
await model.selectProject(picked.project);
|
||||
} else if (picked?.action) {
|
||||
await picked.action();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user