@@ -18,7 +18,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
18
18
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs' ;
19
19
import { URI } from 'vs/base/common/uri' ;
20
20
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
21
- import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
21
+ import { IWorkspaceContextService , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
22
22
import { IWorkspaceTagsService } from 'vs/workbench/contrib/tags/common/workspaceTags' ;
23
23
import { getErrorMessage } from 'vs/base/common/errors' ;
24
24
import { Categories } from 'vs/platform/action/common/actionCommonCategories' ;
@@ -40,6 +40,7 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
40
40
private readonly currentProfileContext : IContextKey < string > ;
41
41
private readonly isCurrentProfileTransientContext : IContextKey < boolean > ;
42
42
private readonly hasProfilesContext : IContextKey < boolean > ;
43
+ private readonly startTime : number = Date . now ( ) ;
43
44
44
45
constructor (
45
46
@IUserDataProfileService private readonly userDataProfileService : IUserDataProfileService ,
@@ -206,6 +207,19 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
206
207
}
207
208
async run ( accessor : ServicesAccessor ) {
208
209
if ( that . userDataProfileService . currentProfile . id !== profile . id ) {
210
+ if ( profile . isDefault && Date . now ( ) - that . startTime < ( 1000 * 20 /* 20 seconds */ ) ) {
211
+ type SwitchToDefaultProfileInfoClassification = {
212
+ owner : 'sandy081' ;
213
+ comment : 'Report if the user switches to the default profile.' ;
214
+ emptyWindow : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'If the current window is empty window or not' } ;
215
+ } ;
216
+ type SwitchToDefaultProfileInfoEvent = {
217
+ emptyWindow : boolean ;
218
+ } ;
219
+ that . telemetryService . publicLog2 < SwitchToDefaultProfileInfoEvent , SwitchToDefaultProfileInfoClassification > ( 'profiles:newwindowprofile' , {
220
+ emptyWindow : that . workspaceContextService . getWorkbenchState ( ) === WorkbenchState . EMPTY
221
+ } ) ;
222
+ }
209
223
return that . userDataProfileManagementService . switchProfile ( profile ) ;
210
224
}
211
225
}
0 commit comments