Fix file search type telemetry in EH

This commit is contained in:
Rob Lourens 2021-08-18 19:44:03 -07:00
parent 188c29a419
commit 76f99cdd6a
2 changed files with 6 additions and 4 deletions

View file

@ -40,7 +40,7 @@ export class NativeExtHostSearch extends ExtHostSearch {
override $enableExtensionHostSearch(): void {
const outputChannel = new OutputChannel('RipgrepSearchEH', this._logService);
this.registerTextSearchProvider(Schemas.file, new RipgrepSearchProvider(outputChannel));
this.registerInternalFileSearchProvider(Schemas.file, new SearchService());
this.registerInternalFileSearchProvider(Schemas.file, new SearchService('fileSearchProvider'));
}
private registerInternalFileSearchProvider(scheme: string, provider: SearchService): IDisposable {

View file

@ -30,6 +30,8 @@ export class SearchService implements IRawSearchService {
private caches: { [cacheKey: string]: Cache; } = Object.create(null);
constructor(private readonly processType: IFileSearchStats['type'] = 'searchProcess') { }
fileSearch(config: IRawFileQuery): Event<ISerializedSearchProgressItem | ISerializedSearchComplete> {
let promise: CancelablePromise<ISerializedSearchSuccess>;
@ -124,7 +126,7 @@ export class SearchService implements IRawSearchService {
type: 'success',
stats: {
detailStats: complete.stats,
type: 'searchProcess',
type: this.processType,
fromCache: false,
resultCount,
sortingTime: undefined
@ -191,7 +193,7 @@ export class SearchService implements IRawSearchService {
detailStats: result.stats,
sortingTime,
fromCache: false,
type: 'searchProcess',
type: this.processType,
workspaceFolderCount: config.folderQueries.length,
resultCount: sortedResults.length
},
@ -226,7 +228,7 @@ export class SearchService implements IRawSearchService {
const stats: IFileSearchStats = {
fromCache: true,
detailStats: cacheStats,
type: 'searchProcess',
type: this.processType,
resultCount: results.length,
sortingTime
};