Skip to content

Commit

Permalink
Merge pull request #208357 from microsoft/surrounding-pheasant
Browse files Browse the repository at this point in the history
add quick access log for beginning of fileSearch call
  • Loading branch information
andreamah authored Mar 22, 2024
2 parents 75e7513 + 0c9a15a commit 93b7e32
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 { }

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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 {
Expand Down

0 comments on commit 93b7e32

Please sign in to comment.