mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 93309f060778f6480a7d2a13913e6e7c624e9bc7
This commit is contained in:
@@ -53,6 +53,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { distinct } from 'vs/base/common/arrays';
|
||||
|
||||
const enum AuthStatus {
|
||||
Initializing = 'Initializing',
|
||||
@@ -98,19 +99,19 @@ const getActivityTitle = (label: string, userDataSyncService: IUserDataSyncServi
|
||||
const getIdentityTitle = (label: string, authenticationProviderId: string, account: AuthenticationSession | undefined, authenticationService: IAuthenticationService): string => {
|
||||
return account ? `${label} (${authenticationService.getDisplayName(authenticationProviderId)}:${account.accountName})` : label;
|
||||
};
|
||||
const turnOnSyncCommand = { id: 'workbench.userData.actions.syncStart', title: localize('turn on sync with category', "Sync: Turn on Sync") };
|
||||
const signInCommand = { id: 'workbench.userData.actions.signin', title: localize('sign in', "Sync: Sign in to sync") };
|
||||
const stopSyncCommand = { id: 'workbench.userData.actions.stopSync', title(authenticationProviderId: string, account: AuthenticationSession | undefined, authenticationService: IAuthenticationService) { return getIdentityTitle(localize('stop sync', "Sync: Turn off Sync"), authenticationProviderId, account, authenticationService); } };
|
||||
const resolveSettingsConflictsCommand = { id: 'workbench.userData.actions.resolveSettingsConflicts', title: localize('showConflicts', "Sync: Show Settings Conflicts") };
|
||||
const resolveKeybindingsConflictsCommand = { id: 'workbench.userData.actions.resolveKeybindingsConflicts', title: localize('showKeybindingsConflicts', "Sync: Show Keybindings Conflicts") };
|
||||
const resolveSnippetsConflictsCommand = { id: 'workbench.userData.actions.resolveSnippetsConflicts', title: localize('showSnippetsConflicts', "Sync: Show User Snippets Conflicts") };
|
||||
const configureSyncCommand = { id: 'workbench.userData.actions.configureSync', title: localize('configure sync', "Sync: Configure") };
|
||||
const turnOnSyncCommand = { id: 'workbench.userData.actions.syncStart', title: localize('turn on sync with category', "Preferences Sync: Turn on...") };
|
||||
const signInCommand = { id: 'workbench.userData.actions.signin', title: localize('sign in', "Preferences Sync: Sign in to sync") };
|
||||
const stopSyncCommand = { id: 'workbench.userData.actions.stopSync', title(authenticationProviderId: string, account: AuthenticationSession | undefined, authenticationService: IAuthenticationService) { return getIdentityTitle(localize('stop sync', "Preferences Sync: Turn off"), authenticationProviderId, account, authenticationService); } };
|
||||
const resolveSettingsConflictsCommand = { id: 'workbench.userData.actions.resolveSettingsConflicts', title: localize('showConflicts', "Preferences Sync: Show Settings Conflicts") };
|
||||
const resolveKeybindingsConflictsCommand = { id: 'workbench.userData.actions.resolveKeybindingsConflicts', title: localize('showKeybindingsConflicts', "Preferences Sync: Show Keybindings Conflicts") };
|
||||
const resolveSnippetsConflictsCommand = { id: 'workbench.userData.actions.resolveSnippetsConflicts', title: localize('showSnippetsConflicts', "Preferences Sync: Show User Snippets Conflicts") };
|
||||
const configureSyncCommand = { id: 'workbench.userData.actions.configureSync', title: localize('configure sync', "Preferences Sync: Configure...") };
|
||||
const showSyncActivityCommand = {
|
||||
id: 'workbench.userData.actions.showSyncActivity', title(userDataSyncService: IUserDataSyncService): string {
|
||||
return getActivityTitle(localize('show sync log', "Sync: Show Log"), userDataSyncService);
|
||||
return getActivityTitle(localize('show sync log', "Preferences Sync: Show Log"), userDataSyncService);
|
||||
}
|
||||
};
|
||||
const showSyncSettingsCommand = { id: 'workbench.userData.actions.syncSettings', title: localize('sync settings', "Sync: Settings"), };
|
||||
const showSyncSettingsCommand = { id: 'workbench.userData.actions.syncSettings', title: localize('sync settings', "Preferences Sync: Show Settings"), };
|
||||
|
||||
export class UserDataSyncWorkbenchContribution extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
@@ -249,9 +250,10 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
private async showSwitchAccountPicker(sessions: readonly AuthenticationSession[]): Promise<void> {
|
||||
return new Promise((resolve, _) => {
|
||||
const quickPick = this.quickInputService.createQuickPick<{ label: string, session: AuthenticationSession }>();
|
||||
quickPick.title = localize('chooseAccountTitle', "Sync: Choose Account");
|
||||
quickPick.title = localize('chooseAccountTitle', "Preferences Sync: Choose Account");
|
||||
quickPick.placeholder = localize('chooseAccount', "Choose an account you would like to use for settings sync");
|
||||
quickPick.items = sessions.map(session => {
|
||||
const dedupedSessions = distinct(sessions, (session) => session.accountName);
|
||||
quickPick.items = dedupedSessions.map(session => {
|
||||
return {
|
||||
label: session.accountName,
|
||||
session: session
|
||||
@@ -577,7 +579,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
if (this.userDataSyncService.status !== SyncStatus.Uninitialized && this.userDataSyncEnablementService.isEnabled() && this.authenticationState.get() === AuthStatus.SignedOut) {
|
||||
badge = new NumberBadge(1, () => localize('sign in to sync', "Sign in to Sync"));
|
||||
} else if (this.userDataSyncService.conflicts.length) {
|
||||
badge = new NumberBadge(this.userDataSyncService.conflicts.reduce((result, syncResourceConflict) => { return result + syncResourceConflict.conflicts.length; }, 0), () => localize('has conflicts', "Sync: Conflicts Detected"));
|
||||
badge = new NumberBadge(this.userDataSyncService.conflicts.reduce((result, syncResourceConflict) => { return result + syncResourceConflict.conflicts.length; }, 0), () => localize('has conflicts', "Preferences Sync: Conflicts Detected"));
|
||||
}
|
||||
|
||||
if (badge) {
|
||||
@@ -608,7 +610,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
const disposables: DisposableStore = new DisposableStore();
|
||||
const quickPick = this.quickInputService.createQuickPick<ConfigureSyncQuickPickItem>();
|
||||
disposables.add(quickPick);
|
||||
quickPick.title = localize('turn on title', "Sync: Turn On");
|
||||
quickPick.title = localize('turn on title', "Preferences Sync: Turn On");
|
||||
quickPick.ok = false;
|
||||
quickPick.customButton = true;
|
||||
if (this.authenticationState.get() === AuthStatus.SignedIn) {
|
||||
@@ -713,7 +715,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
const disposables: DisposableStore = new DisposableStore();
|
||||
const quickPick = this.quickInputService.createQuickPick<ConfigureSyncQuickPickItem>();
|
||||
disposables.add(quickPick);
|
||||
quickPick.title = localize('turn on sync', "Turn on Sync");
|
||||
quickPick.title = localize('configure sync', "Preferences Sync: Configure...");
|
||||
quickPick.placeholder = localize('configure sync placeholder', "Choose what to sync");
|
||||
quickPick.canSelectMany = true;
|
||||
quickPick.ignoreFocusOut = true;
|
||||
@@ -888,7 +890,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: turnOnSyncCommand.id,
|
||||
title: localize('global activity turn on sync', "Turn on Sync...")
|
||||
title: localize('global activity turn on sync', "Preferences Sync: Turn on...")
|
||||
},
|
||||
when: turnOnSyncWhenContext,
|
||||
order: 1
|
||||
@@ -901,7 +903,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: turnOnSyncCommand.id,
|
||||
title: localize('global activity turn on sync', "Turn on Sync...")
|
||||
title: localize('global activity turn on sync', "Preferences Sync: Turn on...")
|
||||
},
|
||||
when: turnOnSyncWhenContext,
|
||||
});
|
||||
@@ -913,7 +915,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
constructor() {
|
||||
super({
|
||||
id: signInCommand.id,
|
||||
title: localize('sign in 2', "Sync: Sign in to sync (1)"),
|
||||
title: localize('sign in 2', "Preferences Sync: Sign in to sync (1)"),
|
||||
menu: {
|
||||
group: '5_sync',
|
||||
id: MenuId.GlobalActivity,
|
||||
@@ -939,7 +941,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: resolveSettingsConflictsCommand.id,
|
||||
title: localize('resolveConflicts_global', "Sync: Show Settings Conflicts (1)"),
|
||||
title: localize('resolveConflicts_global', "Preferences Sync: Show Settings Conflicts (1)"),
|
||||
},
|
||||
when: resolveSettingsConflictsWhenContext,
|
||||
order: 2
|
||||
@@ -948,7 +950,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: resolveSettingsConflictsCommand.id,
|
||||
title: localize('resolveConflicts_global', "Sync: Show Settings Conflicts (1)"),
|
||||
title: localize('resolveConflicts_global', "Preferences Sync: Show Settings Conflicts (1)"),
|
||||
},
|
||||
when: resolveSettingsConflictsWhenContext,
|
||||
order: 2
|
||||
@@ -966,7 +968,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: resolveKeybindingsConflictsCommand.id,
|
||||
title: localize('resolveKeybindingsConflicts_global', "Sync: Show Keybindings Conflicts (1)"),
|
||||
title: localize('resolveKeybindingsConflicts_global', "Preferences Sync: Show Keybindings Conflicts (1)"),
|
||||
},
|
||||
when: resolveKeybindingsConflictsWhenContext,
|
||||
order: 2
|
||||
@@ -975,7 +977,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: resolveKeybindingsConflictsCommand.id,
|
||||
title: localize('resolveKeybindingsConflicts_global', "Sync: Show Keybindings Conflicts (1)"),
|
||||
title: localize('resolveKeybindingsConflicts_global', "Preferences Sync: Show Keybindings Conflicts (1)"),
|
||||
},
|
||||
when: resolveKeybindingsConflictsWhenContext,
|
||||
order: 2
|
||||
@@ -996,7 +998,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: resolveSnippetsConflictsCommand.id,
|
||||
title: localize('resolveSnippetsConflicts_global', "Sync: Show User Snippets Conflicts ({0})", conflicts?.length || 1),
|
||||
title: localize('resolveSnippetsConflicts_global', "Preferences Sync: Show User Snippets Conflicts ({0})", conflicts?.length || 1),
|
||||
},
|
||||
when: resolveSnippetsConflictsWhenContext,
|
||||
order: 2
|
||||
@@ -1005,7 +1007,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
group: '5_sync',
|
||||
command: {
|
||||
id: resolveSnippetsConflictsCommand.id,
|
||||
title: localize('resolveSnippetsConflicts_global', "Sync: Show User Snippets Conflicts ({0})", conflicts?.length || 1),
|
||||
title: localize('resolveSnippetsConflicts_global', "Preferences Sync: Show User Snippets Conflicts ({0})", conflicts?.length || 1),
|
||||
},
|
||||
when: resolveSnippetsConflictsWhenContext,
|
||||
order: 2
|
||||
@@ -1023,7 +1025,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.userData.actions.syncStatus',
|
||||
title: localize('sync is on', "Sync is on"),
|
||||
title: localize('sync is on', "Preferences Sync: On"),
|
||||
menu: [
|
||||
{
|
||||
id: MenuId.GlobalActivity,
|
||||
@@ -1262,8 +1264,8 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio
|
||||
const result = await this.dialogService.confirm({
|
||||
type: 'info',
|
||||
title: isRemote
|
||||
? localize('Sync accept remote', "Sync: {0}", acceptRemoteLabel)
|
||||
: localize('Sync accept local', "Sync: {0}", acceptLocalLabel),
|
||||
? localize('Sync accept remote', "Preferences Sync: {0}", acceptRemoteLabel)
|
||||
: localize('Sync accept local', "Preferences Sync: {0}", acceptLocalLabel),
|
||||
message: isRemote
|
||||
? localize('confirm replace and overwrite local', "Would you like to accept remote {0} and replace local {1}?", syncAreaLabel.toLowerCase(), syncAreaLabel.toLowerCase())
|
||||
: localize('confirm replace and overwrite remote', "Would you like to accept local {0} and replace remote {1}?", syncAreaLabel.toLowerCase(), syncAreaLabel.toLowerCase()),
|
||||
|
||||
@@ -36,7 +36,7 @@ export class UserDataSyncViewContribution implements IWorkbenchContribution {
|
||||
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
|
||||
{
|
||||
id: 'workbench.view.sync',
|
||||
name: localize('sync', "Sync"),
|
||||
name: localize('sync preferences', "Preferences Sync"),
|
||||
ctorDescriptor: new SyncDescriptor(
|
||||
ViewPaneContainer,
|
||||
['workbench.view.sync', `workbench.view.sync.state`, { mergeViewWithContainerWhenSingleView: true }]
|
||||
@@ -80,7 +80,7 @@ export class UserDataSyncViewContribution implements IWorkbenchContribution {
|
||||
title: remote ?
|
||||
{ value: localize('workbench.action.showSyncRemoteBackup', "Show Remote Backup"), original: `Show Remote Backup` }
|
||||
: { value: localize('workbench.action.showSyncLocalBackup', "Show Local Backup"), original: `Show Local Backup` },
|
||||
category: { value: localize('sync', "Sync"), original: `Sync` },
|
||||
category: { value: localize('sync preferences', "Preferences Sync"), original: `Preferences Sync` },
|
||||
menu: {
|
||||
id: MenuId.CommandPalette,
|
||||
when: CONTEXT_SYNC_ENABLEMENT
|
||||
|
||||
@@ -33,7 +33,8 @@ registerAction2(class OpenSyncBackupsFolder extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.userData.actions.openSyncBackupsFolder',
|
||||
title: localize('Open Backup folder', "Sync: Open Local Backups Folder"),
|
||||
title: { value: localize('Open Backup folder', "Open Local Backups Folder"), original: 'Open Local Backups Folder' },
|
||||
category: { value: localize('sync preferences', "Preferences Sync"), original: `Preferences Sync` },
|
||||
menu: {
|
||||
id: MenuId.CommandPalette,
|
||||
when: CONTEXT_SYNC_STATE.notEqualsTo(SyncStatus.Uninitialized),
|
||||
|
||||
Reference in New Issue
Block a user