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 454 forks source link

statusBarVisibility not hiding build,debug,launch #3988

Closed florenso closed 1 month ago

florenso commented 3 months ago

Brief Issue Summary

if i config cmake.options.statusBarVisibility as hidden, it does not hide the buttons build, debug and launch in the status bar.

i can hide them with cmake.options.advanced but i dont think this is expected behaviour

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

snehara99 commented 3 months ago

Hi @florenso, if cmake.options.advanced is empty (like cmake.options.advanced: {}), then those buttons should be hidden. Specifically, cmake.options.advanced has to be empty and not simply omitted from the settings file, because the default in cmake.options.advanced is to set those 3 buttons as visible.

In your initial case, if cmake.options.advanced is omitted and not empty, what you describe is expected behavior. Is that the case?

snehara99 commented 3 months ago

After investigating a bit, I see that the buttons aren't hidden even if cmake.advanced.options is set to {}, which is a bug. We'll add this to our backlog, thank you for pointing this out!

snehara99 commented 1 month ago

Hi @florenso , thank you for your patience. After looking into this more, I realized that it isn't a bug that the buttons aren't hidden even if "cmake.advanced.options" is set to {} because VS Code handles setting {} as setting nothing, which results in the default behavior. So this isn't a bug but by design.

However, here is how you can adjust your settings for your desired initial outcome of hiding the default 'build', 'debug', and 'launch' options in the status bar. You have two options:

1) Following the "cmake.options.statusBarVisibility" at all times, and only hiding the default status bar options when "cmake.options.statusBarVisibility" is set to "hidden".

"cmake.options.statusBarVisibility": "hidden"
"cmake.options.advanced": {
    "build": {
        "inheritDefault": "hidden"
    },
    "launch": {
        "inheritDefault": "hidden"
    },
    "debug": {
        "inheritDefault": "hidden"
    }
}

2) Hiding the default status bar options at all times, even when "cmake.options.statusBarVisibility" isn't set to "hidden".

"cmake.options.statusBarVisibility": "hidden"
"cmake.options.advanced": {
    "build": {
        "statusBarVisibility": "hidden"
    },
    "launch": {
        "statusBarVisibility": "hidden"
    },
    "debug": {
        "statusBarVisibility": "hidden"
    }
}

Thank you for pointing this out, even if it was by design. If you feel the settings should behave differently, then feel free to make another issue with how you believe it should behave. If we get enough support then we will look into it as an improvement.