From 573f7ccc82c88ba954c2e2f1f0e49e35d5043588 Mon Sep 17 00:00:00 2001 From: moyo1997 <54333118+moyo1997@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:44:16 -0700 Subject: [PATCH] show userpresets in project outline (#3877) --- CHANGELOG.md | 1 + src/projectOutline/projectOutline.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c0a8f70d..43cb3b61d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Bug Fixes: - Fix issue where `cmake.preferredGenerators` wasn't falling back to the next entry when the first entry didn't exist [#2709](https://github.com/microsoft/vscode-cmake-tools/issues/2709) - Potential fix for attempting to load a non-variants file as a variants file and throwing a parse exception [#3727](https://github.com/microsoft/vscode-cmake-tools/issues/3727) +- Fix issue where `cmakeUserPresets.json` not showing up in project outline. [#3832](https://github.com/microsoft/vscode-cmake-tools/issues/3832) - Fix edge case where parsing tests fails when additional output is printed before tests json. [#3750](https://github.com/microsoft/vscode-cmake-tools/issues/3750) - Fix issue where `Configure with CMake Debugger` fails on restart because the previously used pipe to CMake Debugger is no longer available. [#3582](https://github.com/microsoft/vscode-cmake-tools/issues/3582) diff --git a/src/projectOutline/projectOutline.ts b/src/projectOutline/projectOutline.ts index 79083922a..335cf658d 100644 --- a/src/projectOutline/projectOutline.ts +++ b/src/projectOutline/projectOutline.ts @@ -501,6 +501,11 @@ export class ProjectNode extends BaseNode { children.push(new SourceFileNode(this.id, this.folder, this.sourceDirectory, possiblePreset)); } + const possibleUserPreset = path.join(this.sourceDirectory, 'CMakeUserPresets.json'); + if (fs.existsSync(possibleUserPreset)) { + children.push(new SourceFileNode(this.id, this.folder, this.sourceDirectory, possibleUserPreset)); + } + return children; }