microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.48k stars 452 forks source link

CMakePresets with a multi-folder workspace isn't integrated correctly #2033

Open TheJCAB opened 3 years ago

TheJCAB commented 3 years ago

Brief Issue Summary

A workspace with multiple folders each with its own CMakePresets.json file is offering the older, non-preset commands.

Expected:

Hit Ctrl+Shift+P, and type "scan".

Apparent Behavior:

You'll see the "CMake: scan for kits" command offered. But... when presets are used you'd expect "CMake: scan for compilers" instead.

Same if you type "preset" instead. None of the preset-related commands are available.

Platform and Versions

bobbrow commented 3 years ago

Just to confirm, you're talking about "multi-root" workspaces, and not a single folder with multiple CMake projects in subfolders of that single folder in the workspace, right?

TheJCAB commented 3 years ago

I'm currently seeing this on a loaded VSCode workspace file with multiple folders in it, each with its own CMake project, and one of which currently uses CMakePresets.json. Each folder is a subdirectory of the directory that contains the workspace file. Whatever you want to call that :-).

We're transitioning, so not all of the folders use presets just yet. But still, it should be possible to use the presets folder and have all the presets commands enabled, at least when a file from that folder is open (contextual switches can be... confusing, but that's life).

bobbrow commented 3 years ago

I got some clarification from @TheJCAB about the workspace:

david-fong commented 2 years ago

I also experience this. My current workaround is to use cmake.ignoreCMakeListsMissing in the .code-workspace settings file (ie. applied to all workspace roots).

nono313 commented 2 years ago

Any news regarding cmake presets and multi-root workspaces ?