未验证 提交 f926c3ab 编写于 作者: R Rob Lourens 提交者: GitHub

Merge pull request #56438 from cdnil/collapse-all-search-results-config

add 'search.collapseAllResults' setting
......@@ -36,7 +36,10 @@ export class SearchDataSource implements IDataSource {
private includeFolderMatch: boolean;
private listener: IDisposable;
constructor(@IWorkspaceContextService private contextService: IWorkspaceContextService) {
constructor(
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IConfigurationService private configurationService: IConfigurationService,
) {
this.updateIncludeFolderMatch();
this.listener = this.contextService.onDidChangeWorkbenchState(() => this.updateIncludeFolderMatch());
}
......@@ -103,6 +106,12 @@ export class SearchDataSource implements IDataSource {
if (numChildren <= 0) {
return false;
}
const collapseOption = this.configurationService.getValue('search.collapseAllResults');
if (collapseOption === 'alwaysCollapse') {
return false;
}
return numChildren < SearchDataSource.AUTOEXPAND_CHILD_LIMIT || element instanceof FolderMatch;
}
......
......@@ -620,6 +620,12 @@ configurationRegistry.registerConfiguration({
enum: ['sidebar', 'panel'],
default: 'sidebar',
description: nls.localize('search.location', "Controls whether the search will be shown as a view in the sidebar or as a panel in the panel area for more horizontal space."),
},
'search.collapseAllResults': {
type: 'string',
enum: ['auto', 'alwaysCollapse'],
default: 'auto',
description: nls.localize('search.collapseAllResults', "Controls whether the search results will be collapsed."),
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册