Skip to content

Commit

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

* add vscode remote
  • Loading branch information
benibenj authored Oct 9, 2024
1 parent d378a6e commit 384ff73
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 @@ -555,6 +556,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 @@ -602,7 +605,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

1 comment on commit 384ff73

@MUHAMMADIHSANALIKAPAHI

Choose a reason for hiding this comment

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

Ok

Please sign in to comment.