Change:
<!-- Do Not Delete This! featurerequesttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --when you import a profile file, vscode will create a new profile but not overwrite current one or merge it to current one Actually I don't need so many profiles, the default profile is enough for me. sometimes I just want to import a keybinding settings from some one, and keep my other settings after I import it, WHAT HAPPEND!!!, all my other settings and extension are gone!!! This is unreasonable! what vscode should do is merging(or overwriting) new keybinding to my old one!! <!-- Describe the feature you'd like. --
Can I have a try on this? I'm new to contributing to this repo but want to try out stuff and get along with starting out at the same time..
Edit: Ignore this, I misread this with other issue
Just wondering is not this same as Can you please distinguish your ask from the other?
partially like But I request more flexibility: Suppose current profile is profile X (X can be default or user profile) when I import A profile, that will be: A.keybinding, A.UI, A.extensions ..... and I choose A.keybindings only to import what I expect: there are 2 options for user when importing: option 1 - merge to current profile, (so X profile's keybindings overwritten but other part of settings kept) option 2 - or create a new profile partially basing on what imported (this is what VSCode currently does )
<!-- -96bd-47a8-a0e8- --This feature request is now a candidate for our backlog. The community has 60 days to the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our . Happy Coding!
<!-- -c9e0-7adb-d31b- --:slightlysmilingface: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our . Happy Coding!
?
I would think this is not a good one to start at and recommend to look for issues labelled with or
I really want to try out.. just to experience and I think I would be able to do it. Even if it's not a good first issue I have contributed to other open source repos. Can I?
Sure, here is the starting point
Thanks a lot for this I was checking your PR with the user-profile feature implementation.. For now I'm just figuring out stuff that is already present. Just a single doubt that I had was about the merging of profiles.. would the editor be like a merge editor that opens whenever we get a merge conflict on git..? Or something else with checkboxes on which settings to get imported from each of the sides(current and imported one)? I'll try my best
For the sake of simplicity, during conflicts, I would simply override with the new one.
Also
Note to self: see for manual workaround.
You can now import and replace any existing profile (including Default profile) from new Profiles Editor UI
To verify: Create a profile A and configure with some settings and extensions Export the profile A to the disk Change some settings and extensions in the profile Import the profile A You should be able to import the profile with name A replacing the existing profile
When I export the profile, install some new extensions, then import the profile with the same name, I would expect the installed extensions to disappear from my extensions list, but that doesn't seem to be the case
It is working for me, ie., I only see the extension from the imported profile. After importing, extensions are getting replaced. Can you please share the exact steps to repro?
Using vscode 1.92.2, I can't figure out how to get to that UI. Where do I find it?
search settings for "profiles experimental"
Thank you!

Discussion:
if (!isUndefined(e.enabled)) { button.enabled = action.enabled; } <ins> if (!isUndefined(e.label)) { button.label = action.label; } </ins> })); } }

if (!isUndefined(e.enabled)) { button.enabled = action.enabled; } <ins> if (!isUndefined(e.label)) { button.label = action.label; } </ins> })); disposables.add(profileElement.onDidChange(e => { if (e.message) {

if (initialName !== value && this.userDataProfilesService.profiles.some(p => p.name === value)) { return { content: localize('profileExists', "Profile with name {0} already exists.", value), <del> type: MessageType.ERROR </del> <ins> type: MessageType.WARNING </ins> }; } return null;

this.message = localize('profileNameRequired', "Profile name is required."); return; } <del> if (this.name !== this.getInitialName() && this.userDataProfilesService.profiles.some(p => p.name === this.name)) { </del> <ins> if (this.shouldValidateName() && this.name !== this.getInitialName() && this.userDataProfilesService.profiles.some(p => p.name === this.name)) { </ins> this.message = localize('profileExists', "Profile with name {0} already exists.", this.name); return; }

return ''; } <ins> shouldValidateName(): boolean { return true; } </ins> save(): void { this.saveScheduler.schedule(); }

} getCopyFromName(): string | undefined { <del> if (isUserDataProfile(this.copyFrom)) { if (this.copyFrom.isDefault) { return localize('copy from default', "{0} (Copy)", this.copyFrom.name); } return this.copyFrom.name; } if (this.template) { return this.template.name; } return undefined; </del> <ins> const name = isUserDataProfile(this.copyFrom) ? this.copyFrom.name : this.template ? this.template.name : undefined; return name === this.userDataProfilesService.defaultProfile.name ? localize('copy from default', "{0} (Copy)", name) : name; </ins> } protected override async getChildrenForResourceType(resourceType: ProfileResourceType): Promise<IProfileChildElement[]> {

return []; } <ins> override shouldValidateName(): boolean { return !this.copyFrom; } </ins> override getInitialName(): string { return this.previewProfile?.name ?? ''; }

if (e.disabled || e.message) { previewProfileAction.enabled = createAction.enabled = !this.newProfileElement?.disabled && !this.newProfileElement?.message; } <ins> if (e.name) { if (this.newProfileElement?.copyFrom && this.userDataProfilesService.profiles.some(p => p.name === this.newProfileElement?.name)) { createAction.label = localize('replace', "Replace"); } else { createAction.label = localize('create', "Create"); } } </ins> })); this._profiles.push([this.newProfileElement, disposables]); this._onDidChange.fire(this.newProfileElement);

if (profile && !profile.isTransient && this.newProfileElement) { this.removeNewProfile(); <del> this.onDidChangeProfiles({ added: [profile], removed: [], updated: [], all: this.userDataProfilesService.profiles }); </del> <ins> const existing = this._profiles.find(([p]) => p.name === profile.name); if (existing) { this._onDidChange.fire(existing[0]); } else { this.onDidChangeProfiles({ added: [profile], removed: [], updated: [], all: this.userDataProfilesService.profiles }); } </ins> } return profile;

if (temp) { return this.userDataProfilesService.createNamedProfile(`${profileName} ${this.getProfileNameIndex(profileName)}`, { ...options, transient: temp }); } <del> enum ImportProfileChoice { Overwrite = 0, CreateNew = 1, Cancel = 2 } const { result } = await this.dialogService.prompt<ImportProfileChoice>({ </del> <ins> const { confirmed } = await this.dialogService.confirm({ </ins> type: Severity.Info, <del> message: localize('profile already exists', "Profile with name '{0}' already exists. Do you want to overwrite it?", profileName), buttons: [ { label: localize({ key: 'overwrite', comment: ['&& denotes a mnemonic'] }, "&&Overwrite"), run: () => ImportProfileChoice.Overwrite }, { label: localize({ key: 'create new', comment: ['&& denotes a mnemonic'] }, "&&Create New Profile"), run: () => ImportProfileChoice.CreateNew }, ], cancelButton: { run: () => ImportProfileChoice.Cancel } }); if (result === ImportProfileChoice.Overwrite) { return profile; } if (result === ImportProfileChoice.Cancel) { return undefined; } // Create new profile const name = await this.quickInputService.input({ placeHolder: localize('name', "Profile name"), title: localize('create new title', "Create New Profile"), value: `${profileName} ${this.getProfileNameIndex(profileName)}`, validateInput: async (value: string) => { if (this.userDataProfilesService.profiles.some(p => p.name === value)) { return localize('profileExists', "Profile with name {0} already exists.", value); } return undefined; } </del> <ins> message: localize('profile already exists', "Profile with name '{0}' already exists. Do you want to replace its contents?", profileName), primaryButton: localize({ key: 'overwrite', comment: ['&& denotes a mnemonic'] }, "&&Replace") </ins> }); <del> if (!name) { </del> <ins> if (!confirmed) { </ins> return undefined; } <del> return this.userDataProfilesService.createNamedProfile(name); </del> <ins> return profile.isDefault ? profile : this.userDataProfilesService.updateProfile(profile, options); </ins> } else { return this.userDataProfilesService.createNamedProfile(profileName, { ...options, transient: temp }); }