Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'search.collapseAllResults' setting #56438

Merged

Conversation

@cdnil
Copy link
Contributor

commented Aug 15, 2018

@cdnil cdnil force-pushed the cdnil:collapse-all-search-results-config branch from 256d16f to 85ca2a1 Aug 16, 2018

@cdnil

This comment has been minimized.

Copy link
Contributor Author

commented Aug 16, 2018

@roblourens Hi there. Sorry I made a mistake about file match count. I have updated the code.

@roblourens

This comment has been minimized.

Copy link
Member

commented Aug 16, 2018

Instead of a boolean, could you make it a string enum setting? Can have "alwaysCollapse" and "auto" (the default).

That leaves us open to adding more "modes" in the future, like "alwaysExpand".

But, don't implement "alwaysExpand" right now. Perf will be an issue with that option.

@@ -103,6 +106,14 @@ export class SearchDataSource implements IDataSource {
if (numChildren <= 0) {
return false;
}
const fileMatchCount = tree.getHTMLElement().children.length;

This comment has been minimized.

Copy link
@roblourens

roblourens Aug 16, 2018

Member

This should not depend on the DOM.

This comment has been minimized.

Copy link
@cdnil

@cdnil cdnil force-pushed the cdnil:collapse-all-search-results-config branch from 85ca2a1 to e64436b Aug 17, 2018

@cdnil

This comment has been minimized.

Copy link
Contributor Author

commented Aug 17, 2018

Your idea is great. There are a lot of string enum settings. It makes the setting more extensible.
I had updated search.collapseAllResults to string enum.

Thanks for your review.

@cdnil cdnil force-pushed the cdnil:collapse-all-search-results-config branch from e64436b to 095758e Aug 17, 2018

@roblourens

This comment has been minimized.

Copy link
Member

commented Aug 17, 2018

Thanks for the PR!

@roblourens roblourens added this to the August 2018 milestone Aug 17, 2018

@roblourens roblourens merged commit f926c3a into microsoft:master Aug 17, 2018

1 of 2 checks passed

VSTS: VS Code 5401 failed
Details
license/cla All CLA requirements met.
Details
@rightaway

This comment has been minimized.

Copy link

commented Aug 17, 2018

In #48641 it was discussed to have an option to expand all the results by default. Would you please include this option? For example call the setting search.resultDisplay and have the options be auto, collapse, expand?

@cdnil

This comment has been minimized.

Copy link
Contributor Author

commented Aug 17, 2018

like @roblourens said above, It will cause a perf issue if all results are always expended. Collapse All button acts as a toggle is a good idea for now.

@roblourens

This comment has been minimized.

Copy link
Member

commented Aug 17, 2018

I tried it, it's not as bad as I thought it might be, I'll add that option 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.