Skip to content

Commit

Permalink
Use async find provider for file scheme only (#232373)
Browse files Browse the repository at this point in the history
Use async find provider only for file scheme (#230592)

* only use asyncfindprovider for file scheme

* add vscode remote
  • Loading branch information
benibenj authored Oct 28, 2024
1 parent 3cb9832 commit d7c7d5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vs/workbench/contrib/files/browser/views/explorerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { basename, relativePath } from '../../../../../base/common/resources.js'
import { IFilesConfigurationService } from '../../../../services/filesConfiguration/common/filesConfigurationService.js';
import { getExcludes, ISearchComplete, ISearchConfiguration, ISearchService, QueryType } from '../../../../services/search/common/search.js';
import { CancellationToken } from '../../../../../base/common/cancellation.js';
import { Schemas } from '../../../../../base/common/network.js';


function hasExpandedRootChild(tree: WorkbenchCompressibleAsyncDataTree<ExplorerItem | ExplorerItem[], ExplorerItem, FuzzyScore>, treeInput: ExplorerItem[]): boolean {
Expand Down Expand Up @@ -559,6 +560,8 @@ export class ExplorerView extends ViewPane implements IExplorerView {

const getFileNestingSettings = (item?: ExplorerItem) => this.configurationService.getValue<IFilesConfiguration>({ resource: item?.root.resource }).explorer.fileNesting;

const rootsSupportFindProvider = this.explorerService.roots.every(root => root.resource.scheme === Schemas.file || root.resource.scheme === Schemas.vscodeRemote);

this.tree = <WorkbenchCompressibleAsyncDataTree<ExplorerItem | ExplorerItem[], ExplorerItem, FuzzyScore>>this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'FileExplorer', container, new ExplorerDelegate(), new ExplorerCompressionDelegate(), [this.renderer],
this.instantiationService.createInstance(ExplorerDataSource, this.filter), {
compressionEnabled: isCompressionEnabled(),
Expand Down Expand Up @@ -606,7 +609,7 @@ export class ExplorerView extends ViewPane implements IExplorerView {
},
paddingBottom: ExplorerDelegate.ITEM_HEIGHT,
overrideStyles: this.getLocationBasedColors().listOverrideStyles,
findResultsProvider: this.instantiationService.createInstance(ExplorerFindProvider),
findResultsProvider: rootsSupportFindProvider ? this.instantiationService.createInstance(ExplorerFindProvider) : undefined,
});
this._register(this.tree);
this._register(this.themeService.onDidColorThemeChange(() => this.tree.rerender()));
Expand Down

0 comments on commit d7c7d5b

Please sign in to comment.