From d7c7d5bd66efeaebded9fada08500da3816d80cf Mon Sep 17 00:00:00 2001 From: Benjamin Christopher Simmonds <44439583+benibenj@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:58:44 +0100 Subject: [PATCH] Use async find provider for file scheme only (#232373) Use async find provider only for file scheme (#230592) * only use asyncfindprovider for file scheme * add vscode remote --- src/vs/workbench/contrib/files/browser/views/explorerView.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index cffed0d9dfd08..46d758ab98943 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -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, treeInput: ExplorerItem[]): boolean { @@ -559,6 +560,8 @@ export class ExplorerView extends ViewPane implements IExplorerView { const getFileNestingSettings = (item?: ExplorerItem) => this.configurationService.getValue({ 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 = >this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'FileExplorer', container, new ExplorerDelegate(), new ExplorerCompressionDelegate(), [this.renderer], this.instantiationService.createInstance(ExplorerDataSource, this.filter), { compressionEnabled: isCompressionEnabled(), @@ -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()));