Fix file search type telemetry in EH
This commit is contained in:
parent
188c29a419
commit
76f99cdd6a
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue