Closed thernstig closed 2 days ago
@thernstig The CMake: pinned commands setting is automatically added after installing the CMake Tools extension. If you resave the settings.json file with the CMake Tools extension disabled, the CMake: pinned commands setting will not be added automatically. Do you have any other questions? Looking forward to hearing from you!
@v-frankwang yes, that is what I noticed, but that goes against every other extension I have seen. Why are you required to pollute our settings.json with settings I have not manually set? If anything, cmake.pinnedCommands
should instead be the default.
Our own settings.json should only ever be manually edited or changed when I invoke commands in VS Code, but automatically like this, I am fairly certain this extension does something wrong doing it like that.
@moyo1997 Customers do not manually add this configuration: cmake.pinnedCommands, this configuration is automatically added to the setting, json file, we will set the setting.json file in this configuration after deleting and re-saving, this configuration will be automatically added again. I tried to remove this configuration in the settings UI and it doesn't work. If I add this setting to the Workspace setting, it doesn't happen in the User setting. I'm not sure if this is happening because cmake tools itself is designed this way or if it's a problem, can you give me some advice? Looking forward to hearing from you!
@v-frankwang exactly, that is what this issue is about. CMake Tools should not add settings on save automatically to any settings.json file.
@moyo1997 Customers do not manually add this configuration: cmake.pinnedCommands, this configuration is automatically added to the setting, json file, we will set the setting.json file in this configuration after deleting and re-saving, this configuration will be automatically added again. I tried to remove this configuration in the settings UI and it doesn't work. If I add this setting to the Workspace setting, it doesn't happen in the User setting. I'm not sure if this is happening because cmake tools itself is designed this way or if it's a problem, can you give me some advice? Looking forward to hearing from you!
@gcampbell-msft I've reproduced the user's problem, but not not sure if it's a bug or not, can you give me some advice about this? Looking forward to receiving your reply!
@v-frankwang @thernstig This sounds like a possible bug and something that we should investigate. Thank you for bringing it to our attention!
@gcampbell-msft Correct there is a bug. Those particular settings are designed to auto populate in the settings file as part of this support: https://github.com/microsoft/vscode-cmake-tools/pull/3690/files#top. However, if one deletes this section and saves the settings file, it should respect it and not re-add it.
@moyo1997 I'm an avid user of many extensions for multiple programming languages, and afaik it is good design that extensions never populate any settings.json files (workspace, user, profile, remote etc.) automatically. A user should do some action for that to happen. If defaults are wanted they should stay as defaults in the default settings.json.
@thernstig thank you! We'll work on addressing this issue.
Can reproduce. What does this setting do again? The description is not at all clear.
@githubuser6000 if you open the CMake sidebar (click the CMake extension's icon in the activity bar) there is a section there showing pinned commands.
Though I completely agree the description is not clear, and should be re-written. Possibly write a new issue about it?
@thernstig Thank you very much for your comment! The place you mentioned is where you can pinned some common cmake commands, you can click run command after the pinned command to run these commands directly. I'm not sure what you're talking about when you say the description is unclear, can you elaborate?
@githubuser6000 if you open the CMake sidebar (click the CMake extension's icon in the activity bar) there is a section there showing pinned commands.
ooOOOoohhhh yea I see it, thanks!
@v-frankwang the description is unclear. It says:
// List of CMake commands to pin.
How would one know where it is pinned and why it is good to use it? If it said something like:
"List of CMake commands to pin in the CMake Tools sidebar section "PINNED COMMANDS"
It would have given:
There could also be an example text as to why one would maybe want to pin commands, but that is a stretch. Something like "Example: Add cmake.X
to make it show up as a quick way to access this command from the sidebar".
My opinion is that the entire feature could be removed 😆 One can always write ctrl+shift+p
and type the command which is arguably faster. This is VS Code's default way to run any command. I have never seen any other extension have a special, dedicated area to add commands specifically for that extension.
@gcampbell-msft The user felt that we didn't describe this feature very well, and he felt that it could all be removed because it might be faster for the user to write and type the commands themselves at any time. Can you give some suggestions?
@thernstig Thanks for the feedback. We can definitely take a note to update our documentation for the feature. We will continue to track this issue for the issue of adding automatically to settings.
@moyo1997 FYI.
Brief Issue Summary
These settings gets automatically added to my VS Code settings.json when I open the JSON file and save it:
Why does it do this?
I am using VS Code Profiles. This setting gets added to the profile settings. Not sure this matters, but adding it for context.
CMake Tools Diagnostics
Debug Log
Additional Information
No response