51
52
constructor(
54
>
@IEnvironmentService private readonly environmentService: IEnvironmentService,
55
>
@ILogService private readonly logService: ILogService,
56
>
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
57
>
@ITelemetryService private readonly telemetryService: ITelemetryService,
58
>
@IStorageService private readonly storageService: IStorageService,
59
>
@ILifecycleService private readonly lifecycleService: ILifecycleService,
60
>
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
61
>
@IConfigurationService private readonly configurationService: IConfigurationService,
62
>
@IWorkspaceEditingService private readonly workspaceEditingService: IWorkspaceEditingService,
63
>
@IDialogService private readonly dialogService: IDialogService,
64
>
@IOpenerService private readonly openerService: IOpenerService,
65
>
) {
66
>
super();
67
>
68
>
const workspace = this.workspaceContextService.getWorkspace();
69
>
const isEmptyWindow = !workspace.configuration && workspace.folders.length === 0;
70
>
const workspaceId = this.workspaceContextService.getWorkspace().id;
71
>
this.storageRoot = isEmptyWindow ?
72
joinPath(this.userDataProfilesService.defaultProfile.globalStorageHome, 'emptyWindowChatSessions') :
73
joinPath(this.environmentService.workspaceStorageHome, workspaceId, 'chatSessions');
75
>
this.previousEmptyWindowStorageRoot = isEmptyWindow ?
76
joinPath(this.environmentService.workspaceStorageHome, 'no-workspace', 'chatSessions') :
77
undefined;
79
>
this.transferredSessionStorageRoot = joinPath(this.userDataProfilesService.defaultProfile.globalStorageHome, 'transferredChatSessions');
80
>
81
>
// Listen to workspace transitions to migrate chat sessions
82
>
this._register(this.workspaceEditingService.onDidEnterWorkspace(event => {
83
const transitionPromise = this.storeQueue.queue(() => this.handleWorkspaceTransition(event.oldWorkspace, event.newWorkspace));
84
event.join(transitionPromise);
86
>
87
>
this._register(this.lifecycleService.onWillShutdown(e => {
88
this.shuttingDown = true;
89
if (!this.storeTask) {