Skip to content

FOLDER grouping in default build target dropdown - #3953

Merged
Garrett Campbell (gcampbell-msft) merged 11 commits into
microsoft:mainfrom
itzandroidtab:folder_target_dropdown
Apr 29, 2025
Merged

Garrett Campbell (gcampbell-msft) merged 11 commits into
microsoft:mainfrom
itzandroidtab:folder_target_dropdown

Conversation

@itzandroidtab

Copy link
Copy Markdown
Contributor

This changes visible behavior

The following changes are proposed:

  • Grouping default build targets dropdown based on CMake FOLDER property

The purpose of this change

When a project has a lot of targets it becomes a hassle to find the right default build target. In the project outline the targets are grouped. This PR also groups the default build target dropdown. Discussion #3949. When clicking on the folder it will show the corresponding targets.

Previous

image

New

image
After selecting the folder:
image

@itzandroidtab

Copy link
Copy Markdown
Contributor Author

Garrett Campbell (@gcampbell-msft) Fatima Qarni (@qarni) What would I need to do to have this PR merged?

@gcampbell-msft

Copy link
Copy Markdown
Collaborator

itzandroidtab (@itzandroidtab) Our apologies for the delay, we've been in the midst of the 1.19 official version release, so we've not been able to review community PR's. We hope to get to this soon, thanks and we appreciate your patience.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

itzandroidtab (@itzandroidtab) First, please include a CHANGELOG.md entry.

Also, I like the idea of this PR and the screenshots you've provided look really good! I haven't taken a deeply close look at the code, but again it looks good.

HOWEVER, I think that this is probably a feature change that each user should be able to control if they would like. I think it'd be a great idea to add a setting that would allow people to choose whether they want this to be a flat list, or whether they want it to be structured using the FOLDER property. I could imagine a scenario where they only have a couple of targets, but if they're using the FOLDER property, even though there are only a limited set of options, they have to do multiple clicks to select it, due to the new implementation you've added.

I'd love to approve this feature, but I think it should have the added ability to control whether we use the flat list or the FOLDER grouping based on a setting. I currently don't have a strong opinion on whether the setting should default to the flat list or the FOLDER grouping.

moyo1997 Ion Todirel (@itodirel) Sinem Akinci (@sinemakinci1) FYI, thoughts?

@itzandroidtab

Copy link
Copy Markdown
Contributor Author

Garrett Campbell (@gcampbell-msft) What would you call this option? And should this option also apply to the side view?

@gcampbell-msft

Copy link
Copy Markdown
Collaborator

Garrett Campbell (@gcampbell-msft) What would you call this option? And should this option also apply to the side view?

I don't believe this option should apply to the side view, the FOLDER grouping should be used there always. The setting should only be used in the build target dropdown.

For the name, it could be something like:
cmake.useFolderPropertyInBuildTargetDropdown

@itzandroidtab

Copy link
Copy Markdown
Contributor Author

Thank you. I will work on this

@gcampbell-msft
Garrett Campbell (gcampbell-msft) marked this pull request as draft December 9, 2024 19:18
@gcampbell-msft

Garrett Campbell (gcampbell-msft) commented Dec 9, 2024 •

Copy link
Copy Markdown
Collaborator

itzandroidtab (@itzandroidtab) Changing this to a draft PR until further changes are made. Please let us know if you have any questions but we will leave it in a draft state for a while, and then if no updates are made we may need to close it in order to keep our PRs clean. We're interested in considering this change once the settings option is added! Thanks!

@itzandroidtab

Copy link
Copy Markdown
Contributor Author

Garrett Campbell (@gcampbell-msft) I have added the feature to the CHANGELOG.md and added the option to enable/disable this feature. By default it is turned on

image

@itzandroidtab
itzandroidtab (itzandroidtab) marked this pull request as ready for review April 21, 2025 22:52

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nit changes, and I'm conflicted about whether to default the setting to true or false.

Personally, I don't think it's a very risky change, but I lean towards defaulting it to false, since it will affect the search capability and most projects are expecting a straight forward list

Comment thread src/cmakeProject.ts Resolved
Comment thread src/cmakeProject.ts Resolved
@itzandroidtab

itzandroidtab (itzandroidtab) commented Apr 25, 2025 •

Copy link
Copy Markdown
Contributor Author

Garrett Campbell (@gcampbell-msft) I have changed the default to false

@gcampbell-msft
Garrett Campbell (gcampbell-msft) merged commit e6291f0 into microsoft:main Apr 29, 2025
Mateusz Pfeifer (fajkomix1990) pushed a commit to fajkomix1990/mati---glowny that referenced this pull request Jul 2, 2025
* added FOLDER grouping in default build target dropdown

* added option to enable/disable folder grouping

* reworked folder grouping to use new option

* Added folder grouping to changelog.md

* Fix url and CMake capitalisation

* changed variables to lowerCamelCase

* bugfix showing folder popup when selecting a target with the same name as a folder

* Moved FolderTarget to cmakeDriver

* Changed the default of 'useFolderPropertyInBuildTargetDropdown' to false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants