@@ -15,7 +15,6 @@ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/
1515import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
1616import { IWindowConfiguration , IWindowService } from 'vs/platform/windows/common/windows' ;
1717import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
18- import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
1918
2019const SshProtocolMatcher = / ^ ( [ ^ @ : ] + @ ) ? ( [ ^ : ] + ) : / ;
2120const SshUrlMatcher = / ^ ( [ ^ @ : ] + @ ) ? ( [ ^ : ] + ) : ( .+ ) $ / ;
@@ -133,13 +132,20 @@ export function getHashedRemotes(text: string): string[] {
133132 } ) ;
134133}
135134
136- class WorkspaceStats {
135+ export class WorkspaceStats implements IWorkbenchContribution {
137136 constructor (
138137 @IFileService private fileService : IFileService ,
139138 @IWorkspaceContextService private contextService : IWorkspaceContextService ,
140139 @ITelemetryService private telemetryService : ITelemetryService ,
141- @IEnvironmentService private environmentService : IEnvironmentService
140+ @IEnvironmentService private environmentService : IEnvironmentService ,
141+ @IWindowService windowService : IWindowService
142142 ) {
143+ this . reportWorkspaceTags ( windowService . getConfiguration ( ) ) ;
144+ this . reportCloudStats ( ) ;
145+ }
146+
147+ public getId ( ) : string {
148+ return 'vs.stats.workspaceStatsReporter' ;
143149 }
144150
145151 private searchArray ( arr : string [ ] , regEx : RegExp ) : boolean {
@@ -415,25 +421,4 @@ class WorkspaceStats {
415421 this . reportAzure ( uris ) ;
416422 }
417423 }
418- }
419-
420- // Telemetry: workspace tags
421- export class WorkspaceStatsReporter implements IWorkbenchContribution {
422-
423- constructor (
424- @IInstantiationService private instantiationService : IInstantiationService ,
425- @IWindowService private windowService : IWindowService
426- ) {
427- this . reportWorkspaceStats ( ) ;
428- }
429-
430- public getId ( ) : string {
431- return 'vs.backup.backupModelTracker' ;
432- }
433-
434- private reportWorkspaceStats ( ) : void {
435- const workspaceStats : WorkspaceStats = this . instantiationService . createInstance ( WorkspaceStats ) ;
436- workspaceStats . reportWorkspaceTags ( this . windowService . getConfiguration ( ) ) ;
437- workspaceStats . reportCloudStats ( ) ;
438- }
439424}
0 commit comments