Skip to content

Commit 0bc37fc

Browse files
update quickstart to fix switching presets (#4494)
1 parent b00f299 commit 0bc37fc

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Bug Fixes:
3030
- Fix ENOENT error at vscode startup on some circumstances [#2855](https://github.com/microsoft/vscode-cmake-tools/issues/2855) Contributed by STMicroelectronics
3131
- Fix repeat execution option in test presets [#4443](https://github.com/microsoft/vscode-cmake-tools/issues/4443)
3232
- Fix bug that makes some build hang [#4424](https://github.com/microsoft/vscode-cmake-tools/issues/4424) and [#4465](https://github.com/microsoft/vscode-cmake-tools/issues/4465)
33+
- Fix issue with switching to presets during Quick Start. [#4409](https://github.com/microsoft/vscode-cmake-tools/issues/4409)
3334

3435
## 1.20.53
3536

src/cmakeProject.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,9 +1295,8 @@ export class CMakeProject {
12951295
if (useCMakePresets === undefined) {
12961296
useCMakePresets = this.workspaceContext.config.useCMakePresets;
12971297
}
1298-
this._useCMakePresets = useCMakePresets === 'always' ? true : useCMakePresets === 'never' ? false : await this.hasPresetsFiles();
1298+
const usingCMakePresets = useCMakePresets === 'always' ? true : useCMakePresets === 'never' ? false : await this.hasPresetsFiles();
12991299

1300-
const usingCMakePresets = this.useCMakePresets;
13011300
if (usingCMakePresets !== this.wasUsingCMakePresets) {
13021301
this.wasUsingCMakePresets = usingCMakePresets;
13031302
await this.setUseCMakePresets(usingCMakePresets);
@@ -3111,6 +3110,7 @@ export class CMakeProject {
31113110
// Regardless of the following configure return code,
31123111
// we want full feature set view for the whole workspace.
31133112
await enableFullFeatureSet(true);
3113+
await this.doUseCMakePresetsChange();
31143114
return (await this.configureInternal(ConfigureTrigger.quickStart, [], ConfigureType.Normal)).result;
31153115
}
31163116

@@ -3148,13 +3148,13 @@ export class CMakeProject {
31483148
}
31493149

31503150
const targetType = await vscode.window.showQuickPick([
3151-
{
3152-
label: 'Library',
3153-
description: localize('create.library', 'Create a library')
3154-
},
31553151
{
31563152
label: 'Executable',
31573153
description: localize('create.executable', 'Create an executable')
3154+
},
3155+
{
3156+
label: 'Library',
3157+
description: localize('create.library', 'Create a library')
31583158
}
31593159
]);
31603160

@@ -3163,13 +3163,13 @@ export class CMakeProject {
31633163
}
31643164

31653165
const addlOptions = (await vscode.window.showQuickPick([
3166-
{
3167-
label: 'CPack',
3168-
description: localize('cpack.support', 'CPack support')
3169-
},
31703166
{
31713167
label: 'CTest',
31723168
description: localize('ctest.support', 'CTest support')
3169+
},
3170+
{
3171+
label: 'CPack',
3172+
description: localize('cpack.support', 'CPack support')
31733173
}
31743174
], { canPickMany: true, placeHolder: localize('select.additional.options', 'Select additional options') }));
31753175

src/presets/presetsController.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,19 @@ export class PresetsController implements vscode.Disposable {
196196
});
197197
}
198198
items.push({
199-
name: SpecialOptions.ToolchainFile,
200-
label: localize('toolchain.file', 'Toolchain File'),
201-
description: localize('description.toolchain.file', 'Configure with a CMake toolchain file')
202-
}, {
203-
name: SpecialOptions.Custom,
204-
label: localize('custom.config.preset', 'Custom'),
205-
description: localize('description.custom.config.preset', 'Add a custom configure preset')
206-
}, {
207199
name: SpecialOptions.CreateFromCompilers,
208200
label: localize('create.from.compilers', 'Create from Compilers'),
209201
description: localize('description.create.from.compilers', 'Create from a pair of compilers on this computer')
202+
},
203+
{
204+
name: SpecialOptions.Custom,
205+
label: localize('custom.config.preset', 'Custom'),
206+
description: localize('description.custom.config.preset', 'Add a custom configure preset')
207+
},
208+
{
209+
name: SpecialOptions.ToolchainFile,
210+
label: localize('toolchain.file', 'Toolchain File'),
211+
description: localize('description.toolchain.file', 'Configure with a CMake toolchain file')
210212
});
211213

212214
const chosenItem = await vscode.window.showQuickPick(items,

0 commit comments

Comments
 (0)