Change:
I love the new profiles but I don't like that the profile resets to "default" if a new workspace is loaded. A profile is a "mode" for me and I want to stay in that mode until I explicitly switch to another mode. I don't want to have VS Code decide what mode to use.
Thanks for the feedback Yes this was discussed in our working group discussion and we are validating this and scenario. IMO it might depend on the context from which I am opening a new workspace. A new workspace shall always use the profile from the current active workspace and if the workspace has already profile associated, it shall use it.
Yes, that would work for me. But today it's not working like this.
Yup, it is not yet currently supported but we are planning to.
We're getting mixed feedback on this. Some users have mentioned they would like to choose which profile to open the new workspace in, instead of opening the most recently used profile or the profile of the current window. I think there's a few options. We can have each workspace remember the profile it is associated with or last opened with, or we can have a setting to choose to open each new workspace in a default profile or the recently used profile.
Since you are getting mixed feedback, why not add a setting, and let the user decide? I agree with and see profile as a mode which VS Code should remain active, until I open an old workspace that used a different profile. But I also see people/scenarios that uses a basic profile for any project (maybe a “light mode”) and would switch to a more complete profile only when necessary.

Discussion:
} getProfile(workspaceIdentifier: WorkspaceIdentifier, profileToUseIfNotSet: IUserDataProfile): IUserDataProfile { <ins> if (!this.enabled) { return this.defaultProfile; } </ins> const workspace = this.getWorkspace(workspaceIdentifier); let profile = URI.isUri(workspace) ? this.profilesObject.workspaces.get(workspace) : this.profilesObject.emptyWindow; if (!profile) {

// User Data Profiles const userDataProfilesService = new BrowserUserDataProfilesService(environmentService, fileService, uriIdentityService, logService); serviceCollection.set(IUserDataProfilesService, userDataProfilesService); <del> const userDataProfileService = new UserDataProfileService(userDataProfilesService.getProfile(isWorkspaceIdentifier(payload) || isSingleFolderWorkspaceIdentifier(payload) ? payload : 'empty-window', userDataProfilesService.defaultProfile), userDataProfilesService); </del> <ins> const lastActiveProfile = environmentService.lastActiveProfile ? userDataProfilesService.profiles.find(p => p.id === environmentService.lastActiveProfile) : undefined; const currentProfile = userDataProfilesService.getProfile(isWorkspaceIdentifier(payload) || isSingleFolderWorkspaceIdentifier(payload) ? payload : 'empty-window', lastActiveProfile ?? userDataProfilesService.defaultProfile); const userDataProfileService = new UserDataProfileService(currentProfile, userDataProfilesService); </ins> serviceCollection.set(IUserDataProfileService, userDataProfileService); // Long running services (workspace, config, storage)

@memoize get disableWorkspaceTrust(): boolean { return !this.options.enableWorkspaceTrust; } <ins> @memoize get lastActiveProfile(): string | undefined { return this.payload?.get('lastActiveProfile'); } </ins> editSessionId: string | undefined = this.options.editSessionId; private payload: Map<string, string> | undefined;

import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { Schemas } from 'vs/base/common/network'; import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; <ins> import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; </ins> /** * A workspace to open in the workbench can either be:

@ILifecycleService private readonly lifecycleService: BrowserLifecycleService, @ILogService private readonly logService: ILogService, @IDialogService private readonly dialogService: IDialogService, <del> @IWorkspaceContextService private readonly contextService: IWorkspaceContextService </del> <ins> @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService, </ins> ) { super();

} private async doOpenWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise<void> { <del> const payload = this.preservePayload(); </del> <ins> const payload = this.preservePayload(false /* not an empty window */); </ins> const fileOpenables: IFileToOpen[] = []; const foldersToAdd: IWorkspaceFolderCreationData[] = [];

this.instantiationService.invokeFunction(accessor => fn(accessor)); } <del> private preservePayload(): Array<unknown> | undefined { </del> <ins> private preservePayload(isEmptyWindow: boolean): Array<unknown> | undefined { </ins> // Selectively copy payload: for now only extension debugging properties are considered <del> let newPayload: Array<unknown> | undefined = undefined; if (this.environmentService.extensionDevelopmentLocationURI) { newPayload = new Array(); </del> <ins> const newPayload: Array<unknown> = new Array(); if (!isEmptyWindow && this.environmentService.extensionDevelopmentLocationURI) { </ins> newPayload.push(['extensionDevelopmentPath', this.environmentService.extensionDevelopmentLocationURI.toString()]); if (this.environmentService.debugExtensionHost.debugId) {

} } <del> return newPayload; </del> <ins> if (!this.userDataProfileService.currentProfile.isDefault) { newPayload.push(['lastActiveProfile', this.userDataProfileService.currentProfile.id]); } return newPayload.length ? newPayload : undefined; </ins> } private getRecentLabel(openable: IWindowOpenable): string {

} private async doOpenEmptyWindow(options?: IOpenEmptyWindowOptions): Promise<void> { <del> return this.doOpen(undefined, { reuse: options?.forceReuseWindow }); </del> <ins> return this.doOpen(undefined, { reuse: options?.forceReuseWindow, payload: this.preservePayload(true /* empty window */) }); </ins> } private async doOpen(workspace: IWorkspace, options?: { reuse?: boolean; payload?: object }): Promise<void> {