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:
@@ -77,8 +77,9 @@ still runs after this one and fills in `justMyCode`, symbol options and the cons
|
|||||||
|
|
||||||
### F5
|
### F5
|
||||||
|
|
||||||
The first time it sees a solution the extension offers to write a `launch.json` entry
|
The first time it sees a solution the extension offers to write a `launch.json` entry.
|
||||||
(*.NET Solution: Create launch.json and tasks.json entries* does it later):
|
Later, run *.NET Solution: Create launch.json and tasks.json entries* from the command
|
||||||
|
palette, or pick it at the bottom of the startup-project list (click the project name):
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
|
|||||||
+19
-4
@@ -23,17 +23,32 @@ async function pickStartupProject(): Promise<void> {
|
|||||||
: 'No solution found in the workspace.');
|
: 'No solution found in the workspace.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const picked = await vscode.window.showQuickPick(
|
type Item = vscode.QuickPickItem & { project?: StartupProject; action?: () => Promise<void> };
|
||||||
candidates.map(project => ({
|
const items: Item[] = candidates.map(project => ({
|
||||||
label: project.info.name,
|
label: project.info.name,
|
||||||
description: vscode.workspace.asRelativePath(project.info.fsPath, false),
|
description: vscode.workspace.asRelativePath(project.info.fsPath, false),
|
||||||
detail: project.info.platforms.length ? `Platforms: ${project.info.platforms.join(', ')}` : undefined,
|
detail: project.info.platforms.length ? `Platforms: ${project.info.platforms.join(', ')}` : undefined,
|
||||||
picked: project === model.startupProject,
|
picked: project === model.startupProject,
|
||||||
project,
|
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 });
|
{ title: `${model.activeSolution?.name}: startup project`, matchOnDescription: true });
|
||||||
if (picked) {
|
if (picked?.project) {
|
||||||
await model.selectProject(picked.project);
|
await model.selectProject(picked.project);
|
||||||
|
} else if (picked?.action) {
|
||||||
|
await picked.action();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ export class StatusBar implements vscode.Disposable {
|
|||||||
`**Solution:** \`${solution.name}\` (${vscode.workspace.asRelativePath(solution.fsPath, false)})`,
|
`**Solution:** \`${solution.name}\` (${vscode.workspace.asRelativePath(solution.fsPath, false)})`,
|
||||||
this.busy ? `\n$(loading~spin) ${this.busy}` : '',
|
this.busy ? `\n$(loading~spin) ${this.busy}` : '',
|
||||||
'',
|
'',
|
||||||
'Click to change the startup project.',
|
'Click to change the startup project, or to create the launch.json / tasks.json entries.',
|
||||||
].join(' \n'));
|
].join(' \n'));
|
||||||
|
|
||||||
const mapped = `${active.projectConfiguration}|${active.projectPlatform}`;
|
const mapped = `${active.projectConfiguration}|${active.projectPlatform}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user