add quick access log for beginning of fileSearch call

This commit is contained in:
andreamah 2024-03-21 19:35:30 -07:00
parent 7eb5c6cff3
commit 0c9a15a6d5

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 {