Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use window.openedWorkspace #159942

Merged
merged 1 commit into from Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,7 +18,7 @@ export class UserDataTransientProfilesHandler extends Disposable {
super();
this._register(lifecycleMainService.onWillLoadWindow(e => {
if (e.reason === LoadReason.LOAD) {
this.unsetTransientProfileForWorkspace(e.window.previousWorkspace ?? 'empty-window');
this.unsetTransientProfileForWorkspace(e.window.openedWorkspace ?? 'empty-window');
}
}));
this._register(lifecycleMainService.onBeforeCloseWindow(window => this.unsetTransientProfileForWorkspace(window.openedWorkspace ?? 'empty-window')));
Expand Down
1 change: 0 additions & 1 deletion src/vs/platform/window/electron-main/window.ts
Expand Up @@ -27,7 +27,6 @@ export interface ICodeWindow extends IDisposable {
readonly win: BrowserWindow | null; /* `null` after being disposed */
readonly config: INativeWindowConfiguration | undefined;

readonly previousWorkspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier;
readonly openedWorkspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier;

readonly profile?: IUserDataProfile;
Expand Down
4 changes: 0 additions & 4 deletions src/vs/platform/windows/electron-main/windowImpl.ts
Expand Up @@ -119,8 +119,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {

get backupPath(): string | undefined { return this._config?.backupPath; }

private _previousWorkspace: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined;
get previousWorkspace(): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined { return this._previousWorkspace; }
get openedWorkspace(): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined { return this._config?.workspace; }

get profile(): IUserDataProfile | undefined { return this.config ? this.userDataProfilesService.getOrSetProfileForWorkspace(this.config.workspace ?? 'empty-window', this.userDataProfilesService.profiles.find(profile => profile.id === this.config?.profiles.profile.id) ?? this.userDataProfilesService.defaultProfile) : undefined; }
Expand Down Expand Up @@ -854,8 +852,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this._win.setTitle(this.productService.nameLong);
}

this._previousWorkspace = this.openedWorkspace;

// Update configuration values based on our window context
// and set it into the config object URL for usage.
this.updateConfiguration(configuration, options);
Expand Down