Merge pull request #208357 from microsoft/surrounding-pheasant

add quick access log for beginning of fileSearch call
This commit is contained in:
Andrea Mah 2024-03-21 23:15:09 -05:00 committed by GitHub
commit 93b7e320e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,6 +55,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { Registry } from 'vs/platform/registry/common/platform';
import { ASK_QUICK_QUESTION_ACTION_ID } from 'vs/workbench/contrib/chat/browser/actions/chatQuickInputActions';
import { IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat';
import { ILogService } from 'vs/platform/log/common/log';
interface IAnythingQuickPickItem extends IPickerQuickAccessItem, IQuickPickItemWithResource { }
@ -162,6 +163,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
@IQuickInputService private readonly quickInputService: IQuickInputService,
@IKeybindingService private readonly keybindingService: IKeybindingService,
@IQuickChatService private readonly quickChatService: IQuickChatService,
@ILogService private readonly logService: ILogService
) {
super(AnythingQuickAccessProvider.PREFIX, {
canAcceptInBackground: true,
@ -644,6 +646,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
}
private doGetFileSearchResults(filePattern: string, token: CancellationToken): Promise<ISearchComplete> {
const start = Date.now();
return this.searchService.fileSearch(
this.fileQueryBuilder.file(
this.contextService.getWorkspace().folders,
@ -652,7 +655,9 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
cacheKey: this.pickState.fileQueryCache?.cacheKey,
maxResults: AnythingQuickAccessProvider.MAX_RESULTS
})
), token);
), token).finally(() => {
this.logService.trace(`QuickAccess fileSearch ${Date.now() - start}ms`);
});
}
private getFileQueryOptions(input: { filePattern?: string; cacheKey?: string; maxResults?: number }): IFileQueryBuilderOptions {