mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge vscode source through 1.62 release (#19981)
* Build breaks 1 * Build breaks * Build breaks * Build breaks * More build breaks * Build breaks (#2512) * Runtime breaks * Build breaks * Fix dialog location break * Update typescript * Fix ASAR break issue * Unit test breaks * Update distro * Fix breaks in ADO builds (#2513) * Bump to node 16 * Fix hygiene errors * Bump distro * Remove reference to node type * Delete vscode specific extension * Bump to node 16 in CI yaml * Skip integration tests in CI builds (while fixing) * yarn.lock update * Bump moment dependency in remote yarn * Fix drop-down chevron style * Bump to node 16 * Remove playwrite from ci.yaml * Skip building build scripts in hygine check
This commit is contained in:
@@ -20,7 +20,7 @@ import { localize } from 'vs/nls';
|
||||
import { MenuId, MenuRegistry, registerAction2, Action2 } from 'vs/platform/actions/common/actions';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ContextKeyEqualsExpr, ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
@@ -33,7 +33,8 @@ import {
|
||||
} from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { FloatingClickWidget } from 'vs/workbench/browser/codeeditor';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IEditorInput, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import * as Constants from 'vs/workbench/contrib/logs/common/logConstants';
|
||||
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
|
||||
@@ -696,7 +697,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
}) as DiffEditorInput[];
|
||||
}
|
||||
|
||||
private getAllConflictsEditorInputs(): IEditorInput[] {
|
||||
private getAllConflictsEditorInputs(): EditorInput[] {
|
||||
return this.editorService.editors.filter(input => {
|
||||
const resource = input instanceof DiffEditorInput ? input.primary.resource : input.resource;
|
||||
return resource && getSyncResourceFromLocalPreview(resource!, this.environmentService) !== undefined;
|
||||
@@ -1161,7 +1162,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
when
|
||||
}, {
|
||||
id: MenuId.ViewContainerTitle,
|
||||
when: ContextKeyEqualsExpr.create('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
when: ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
group: 'navigation',
|
||||
order: 2
|
||||
}]
|
||||
@@ -1185,7 +1186,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
when: ContextKeyExpr.and(CONTEXT_SYNC_STATE.notEqualsTo(SyncStatus.Uninitialized)),
|
||||
}, {
|
||||
id: MenuId.ViewContainerTitle,
|
||||
when: ContextKeyEqualsExpr.create('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
when: ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
group: 'navigation',
|
||||
order: 1
|
||||
}],
|
||||
@@ -1234,7 +1235,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
id: 'workbench.userDataSync.actions.help',
|
||||
title: CATEGORIES.Help.value
|
||||
},
|
||||
when: ContextKeyEqualsExpr.create('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
when: ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
group: '1_help',
|
||||
});
|
||||
}
|
||||
@@ -1267,7 +1268,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
title: localize('workbench.actions.syncData.reset', "Clear Data in Cloud..."),
|
||||
menu: [{
|
||||
id: MenuId.ViewContainerTitle,
|
||||
when: ContextKeyEqualsExpr.create('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
when: ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID),
|
||||
group: '0_configure',
|
||||
}],
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import { TreeViewPane } from 'vs/workbench/browser/parts/views/treeView';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IUserDataSyncService, Change, MergeState, SyncResource } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { registerAction2, Action2, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { ContextKeyExpr, ContextKeyEqualsExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
@@ -18,7 +18,7 @@ import { Disposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
import { IUserDataSyncWorkbenchService, getSyncAreaLabel, IUserDataSyncPreview, IUserDataSyncResource, SYNC_MERGES_VIEW_ID } from 'vs/workbench/services/userDataSync/common/userDataSync';
|
||||
import { isEqual, basename } from 'vs/base/common/resources';
|
||||
import { IDecorationsProvider, IDecorationData, IDecorationsService } from 'vs/workbench/services/decorations/browser/decorations';
|
||||
import { IDecorationsProvider, IDecorationData, IDecorationsService } from 'vs/workbench/services/decorations/common/decorations';
|
||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { listWarningForeground, listDeemphasizedForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
@@ -164,7 +164,7 @@ export class UserDataSyncMergesViewPane extends TreeViewPane {
|
||||
icon: Codicon.cloudDownload,
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.equals('viewItem', 'sync-resource-preview')),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.equals('viewItem', 'sync-resource-preview')),
|
||||
group: 'inline',
|
||||
order: 1,
|
||||
},
|
||||
@@ -184,7 +184,7 @@ export class UserDataSyncMergesViewPane extends TreeViewPane {
|
||||
icon: Codicon.cloudUpload,
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.equals('viewItem', 'sync-resource-preview')),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.equals('viewItem', 'sync-resource-preview')),
|
||||
group: 'inline',
|
||||
order: 2,
|
||||
},
|
||||
@@ -204,7 +204,7 @@ export class UserDataSyncMergesViewPane extends TreeViewPane {
|
||||
icon: Codicon.merge,
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.equals('viewItem', 'sync-resource-preview')),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.equals('viewItem', 'sync-resource-preview')),
|
||||
group: 'inline',
|
||||
order: 3,
|
||||
},
|
||||
@@ -224,7 +224,7 @@ export class UserDataSyncMergesViewPane extends TreeViewPane {
|
||||
icon: Codicon.discard,
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.or(ContextKeyExpr.equals('viewItem', 'sync-resource-accepted'), ContextKeyExpr.equals('viewItem', 'sync-resource-conflict'))),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', SYNC_MERGES_VIEW_ID), ContextKeyExpr.or(ContextKeyExpr.equals('viewItem', 'sync-resource-accepted'), ContextKeyExpr.equals('viewItem', 'sync-resource-conflict'))),
|
||||
group: 'inline',
|
||||
order: 3,
|
||||
},
|
||||
@@ -465,6 +465,10 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.configurationService.getValue('diffEditor.renderSideBySide')) {
|
||||
return isEqual(userDataSyncResource.merged, model.uri);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { isWeb } from 'vs/base/common/platform';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { IUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { IViewsService } from 'vs/workbench/common/views';
|
||||
import { VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -45,7 +45,7 @@ export class UserDataSyncTrigger extends Disposable implements IWorkbenchContrib
|
||||
}
|
||||
}
|
||||
|
||||
private getUserDataEditorInputSource(editorInput: IEditorInput | undefined): string | undefined {
|
||||
private getUserDataEditorInputSource(editorInput: EditorInput | undefined): string | undefined {
|
||||
if (!editorInput) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { TreeView, TreeViewPane } from 'vs/workbench/browser/parts/views/treeVie
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ALL_SYNC_RESOURCES, SyncResource, IUserDataSyncService, ISyncResourceHandle as IResourceHandle, SyncStatus, IUserDataSyncResourceEnablementService, IUserDataAutoSyncService, UserDataSyncError, UserDataSyncErrorCode, IUserDataAutoSyncEnablementService, getLastSyncResourceUri } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { registerAction2, Action2, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { ContextKeyExpr, ContextKeyEqualsExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { FolderThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
@@ -32,6 +32,7 @@ import { API_OPEN_DIFF_EDITOR_COMMAND_ID, API_OPEN_EDITOR_COMMAND_ID } from 'vs/
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
|
||||
export class UserDataSyncDataViews extends Disposable {
|
||||
|
||||
@@ -107,7 +108,7 @@ export class UserDataSyncDataViews extends Disposable {
|
||||
icon: Codicon.edit,
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', id)),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', id)),
|
||||
group: 'inline',
|
||||
},
|
||||
});
|
||||
@@ -127,7 +128,7 @@ export class UserDataSyncDataViews extends Disposable {
|
||||
title: localize('workbench.actions.sync.turnOffSyncOnMachine', "Turn off Settings Sync"),
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', id), ContextKeyEqualsExpr.create('viewItem', 'sync-machine')),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', id), ContextKeyExpr.equals('viewItem', 'sync-machine')),
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -182,7 +183,7 @@ export class UserDataSyncDataViews extends Disposable {
|
||||
title: localize('workbench.actions.sync.resolveResourceRef', "Show raw JSON sync data"),
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', viewId), ContextKeyExpr.regex('viewItem', /sync-resource-.*/i))
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId), ContextKeyExpr.regex('viewItem', /sync-resource-.*/i))
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -193,6 +194,31 @@ export class UserDataSyncDataViews extends Disposable {
|
||||
}
|
||||
});
|
||||
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: `workbench.actions.sync.compareWithLocal`,
|
||||
title: localize('workbench.actions.sync.compareWithLocal', "Compare with Local"),
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId), ContextKeyExpr.regex('viewItem', /sync-associatedResource-.*/i))
|
||||
},
|
||||
});
|
||||
}
|
||||
async run(accessor: ServicesAccessor, handle: TreeViewItemHandleArg): Promise<void> {
|
||||
const commandService = accessor.get(ICommandService);
|
||||
const { resource, comparableResource } = <{ resource: string, comparableResource: string }>JSON.parse(handle.$treeItemHandle);
|
||||
const remoteResource = URI.parse(resource);
|
||||
const localResource = URI.parse(comparableResource);
|
||||
return commandService.executeCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID,
|
||||
remoteResource,
|
||||
localResource,
|
||||
localize('remoteToLocalDiff', "{0} ↔ {1}", localize({ key: 'leftResourceName', comment: ['remote as in file in cloud'] }, "{0} (Remote)", basename(remoteResource)), localize({ key: 'rightResourceName', comment: ['local as in file in disk'] }, "{0} (Local)", basename(localResource))),
|
||||
undefined
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
@@ -201,7 +227,7 @@ export class UserDataSyncDataViews extends Disposable {
|
||||
icon: Codicon.discard,
|
||||
menu: {
|
||||
id: MenuId.ViewItemContext,
|
||||
when: ContextKeyExpr.and(ContextKeyEqualsExpr.create('view', viewId), ContextKeyExpr.regex('viewItem', /sync-resource-.*/i)),
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId), ContextKeyExpr.regex('viewItem', /sync-resource-.*/i)),
|
||||
group: 'inline',
|
||||
},
|
||||
});
|
||||
@@ -254,7 +280,8 @@ export class UserDataSyncDataViews extends Disposable {
|
||||
}
|
||||
|
||||
interface ISyncResourceHandle extends IResourceHandle {
|
||||
syncResource: SyncResource
|
||||
syncResource: SyncResource;
|
||||
previous?: IResourceHandle;
|
||||
}
|
||||
|
||||
interface SyncResourceHandleTreeItem extends ITreeItem {
|
||||
@@ -322,17 +349,31 @@ abstract class UserDataSyncActivityViewDataProvider implements ITreeViewDataProv
|
||||
}
|
||||
|
||||
protected async getChildrenForSyncResourceTreeItem(element: SyncResourceHandleTreeItem): Promise<ITreeItem[]> {
|
||||
const associatedResources = await this.userDataSyncService.getAssociatedResources((<SyncResourceHandleTreeItem>element).syncResourceHandle.syncResource, (<SyncResourceHandleTreeItem>element).syncResourceHandle);
|
||||
const syncResourceHandle = (<SyncResourceHandleTreeItem>element).syncResourceHandle;
|
||||
const associatedResources = await this.userDataSyncService.getAssociatedResources(syncResourceHandle.syncResource, syncResourceHandle);
|
||||
const previousAssociatedResources = syncResourceHandle.previous ? await this.userDataSyncService.getAssociatedResources(syncResourceHandle.syncResource, syncResourceHandle.previous) : [];
|
||||
return associatedResources.map(({ resource, comparableResource }) => {
|
||||
const handle = JSON.stringify({ resource: resource.toString(), comparableResource: comparableResource.toString() });
|
||||
const leftResourceName = localize({ key: 'leftResourceName', comment: ['remote as in file in cloud'] }, "{0} (Remote)", basename(resource));
|
||||
const rightResourceName = localize({ key: 'rightResourceName', comment: ['local as in file in disk'] }, "{0} (Local)", basename(comparableResource));
|
||||
const previousResource = previousAssociatedResources.find(previous => basename(previous.resource) === basename(resource))?.resource;
|
||||
return {
|
||||
handle,
|
||||
collapsibleState: TreeItemCollapsibleState.None,
|
||||
resourceUri: resource,
|
||||
command: { id: API_OPEN_DIFF_EDITOR_COMMAND_ID, title: '', arguments: [resource, comparableResource, localize('sideBySideLabels', "{0} ↔ {1}", leftResourceName, rightResourceName), undefined] },
|
||||
contextValue: `sync-associatedResource-${(<SyncResourceHandleTreeItem>element).syncResourceHandle.syncResource}`
|
||||
command: previousResource ? {
|
||||
id: API_OPEN_DIFF_EDITOR_COMMAND_ID,
|
||||
title: '',
|
||||
arguments: [
|
||||
previousResource,
|
||||
resource,
|
||||
localize('sideBySideLabels', "{0} ↔ {1}", `${basename(resource)} (${fromNow(syncResourceHandle.previous!.created, true)})`, `${basename(resource)} (${fromNow(syncResourceHandle.created, true)})`),
|
||||
undefined
|
||||
]
|
||||
} : {
|
||||
id: API_OPEN_EDITOR_COMMAND_ID,
|
||||
title: '',
|
||||
arguments: [resource, undefined, undefined]
|
||||
},
|
||||
contextValue: `sync-associatedResource-${syncResourceHandle.syncResource}`
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -341,7 +382,8 @@ abstract class UserDataSyncActivityViewDataProvider implements ITreeViewDataProv
|
||||
if (this.syncResourceHandlesPromise === undefined) {
|
||||
this.syncResourceHandlesPromise = Promise.all(ALL_SYNC_RESOURCES.map(async syncResource => {
|
||||
const resourceHandles = await this.getResourceHandles(syncResource);
|
||||
return resourceHandles.map(resourceHandle => ({ ...resourceHandle, syncResource }));
|
||||
resourceHandles.sort((a, b) => b.created - a.created);
|
||||
return resourceHandles.map((resourceHandle, index) => ({ ...resourceHandle, syncResource, previous: resourceHandles[index + 1] }));
|
||||
})).then(result => flatten(result).sort((a, b) => b.created - a.created));
|
||||
}
|
||||
return this.syncResourceHandlesPromise;
|
||||
|
||||
Reference in New Issue
Block a user