Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)

* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898

* Fixes and cleanup

* Distro

* Fix hygiene yarn

* delete no yarn lock changes file

* Fix hygiene

* Fix layer check

* Fix CI

* Skip lib checks

* Remove tests deleted in vs code

* Fix tests

* Distro

* Fix tests and add removed extension point

* Skip failing notebook tests for now

* Disable broken tests and cleanup build folder

* Update yarn.lock and fix smoke tests

* Bump sqlite

* fix contributed actions and file spacing

* Fix user data path

* Update yarn.locks

Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
Charles Gagnon
2021-06-17 08:17:11 -07:00
committed by GitHub
parent fdcb97c7f7
commit 3cb2f552a6
2582 changed files with 124827 additions and 87099 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors';
import { Event } from 'vs/base/common/event';
import { Disposable, DisposableStore, dispose, MutableDisposable, toDisposable, IDisposable } from 'vs/base/common/lifecycle';
import { isEqual, basename } from 'vs/base/common/resources';
@@ -111,7 +111,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
@IOutputService private readonly outputService: IOutputService,
@IUserDataSyncAccountService readonly authTokenService: IUserDataSyncAccountService,
@IUserDataAutoSyncEnablementService private readonly userDataAutoSyncEnablementService: IUserDataAutoSyncEnablementService,
@IUserDataAutoSyncService private readonly userDataAutoSyncService: IUserDataAutoSyncService,
@IUserDataAutoSyncService userDataAutoSyncService: IUserDataAutoSyncService,
@ITextModelService textModelResolverService: ITextModelService,
@IPreferencesService private readonly preferencesService: IPreferencesService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@@ -288,7 +288,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
case UserDataSyncErrorCode.TurnedOff:
this.notificationService.notify({
severity: Severity.Info,
message: localize('turned off', "Settings sync was turned off from another device, please sign in again to turn on sync."),
message: localize('turned off', "Settings sync was turned off from another device, please turn on sync again."),
actions: {
primary: [new Action('turn on sync', localize('turn on sync', "Turn on Settings Sync..."), undefined, true, () => this.turnOn())]
}
@@ -323,11 +323,34 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
}
});
return;
case UserDataSyncErrorCode.ServiceChanged:
this.notificationService.notify({
severity: Severity.Info,
message: this.userDataSyncStoreManagementService.userDataSyncStore?.type === 'insiders' ?
localize('service switched to insiders', "Settings Sync has been switched to insiders service") :
localize('service switched to stable', "Settings Sync has been switched to stable service"),
});
return;
case UserDataSyncErrorCode.DefaultServiceChanged:
if (isEqual(this.userDataSyncStoreManagementService.userDataSyncStore?.url, this.userDataSyncStoreManagementService.userDataSyncStore?.insidersUrl)) {
// Settings sync is using separate service
if (this.userDataAutoSyncEnablementService.isEnabled()) {
this.notificationService.notify({
severity: Severity.Info,
message: localize('switched to insiders', "Settings sync now uses a separate service, more information is available in the [release notes](https://code.visualstudio.com/updates/v1_48#_settings-sync)."),
message: localize('using separate service', "Settings sync now uses a separate service, more information is available in the [Settings Sync Documentation](https://aka.ms/vscode-settings-sync-help#_syncing-stable-versus-insiders)."),
});
}
// If settings sync got turned off then ask user to turn on sync again.
else {
this.notificationService.notify({
severity: Severity.Info,
message: localize('service changed and turned off', "Settings sync was turned off because {0} now uses a separate service. Please turn on sync again.", this.productService.nameLong),
actions: {
primary: [new Action('turn on sync', localize('turn on sync', "Turn on Settings Sync..."), undefined, true, () => this.turnOn())]
}
});
}
return;
@@ -487,8 +510,10 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
this.notificationService.error(localize('auth failed', "Error while turning on Settings Sync: Authentication failed."));
return;
}
this.notificationService.error(localize('turn on failed with user data sync error', "Error while turning on Settings Sync. Please check [logs]({0}) for more details.", `command:${SHOW_SYNC_LOG_COMMAND_ID}`));
} else {
this.notificationService.error(localize({ key: 'turn on failed', comment: ['Substitution is for error reason'] }, "Error while turning on Settings Sync. {0}", getErrorMessage(e)));
}
this.notificationService.error(localize('turn on failed', "Error while turning on Settings Sync. Please check [logs]({0}) for more details.", `command:${SHOW_SYNC_LOG_COMMAND_ID}`));
}
}
@@ -1030,7 +1055,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
});
}
run(accessor: ServicesAccessor): Promise<any> {
return that.userDataAutoSyncService.triggerSync([syncNowCommand.id], false, true);
return that.userDataSyncWorkbenchService.syncNow();
}
}));
}
@@ -1308,7 +1333,7 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio
this.acceptChangesButton = undefined;
}
dispose(): void {
override dispose(): void {
this.disposeAcceptChangesWidgetRenderer();
super.dispose();
}

View File

@@ -77,7 +77,7 @@ export class UserDataSyncMergesViewPane extends TreeViewPane {
this.registerActions();
}
protected renderTreeView(container: HTMLElement): void {
protected override renderTreeView(container: HTMLElement): void {
super.renderTreeView(DOM.append(container, DOM.$('')));
this.createButtons(container);
@@ -101,7 +101,7 @@ export class UserDataSyncMergesViewPane extends TreeViewPane {
this._register(this.cancelButton.onDidClick(() => this.cancel()));
}
protected layoutTreeView(height: number, width: number): void {
protected override layoutTreeView(height: number, width: number): void {
const buttonContainerHeight = 78;
this.buttonsContainer.style.height = `${buttonContainerHeight}px`;
this.buttonsContainer.style.width = `${width}px`;
@@ -499,7 +499,7 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio
this.acceptChangesButton = undefined;
}
dispose(): void {
override dispose(): void {
this.disposeAcceptChangesWidgetRenderer();
super.dispose();
}

View File

@@ -28,6 +28,7 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
import { flatten } from 'vs/base/common/arrays';
import { UserDataSyncMergesViewPane } from 'vs/workbench/contrib/userDataSync/browser/userDataSyncMergesView';
import { basename } from 'vs/base/common/resources';
import { API_OPEN_DIFF_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
export class UserDataSyncDataViews extends Disposable {
@@ -216,33 +217,6 @@ export class UserDataSyncDataViews extends Disposable {
}
});
registerAction2(class extends Action2 {
constructor() {
super({
id: `workbench.actions.sync.compareWithLocal`,
title: localize({ key: 'workbench.actions.sync.compareWithLocal', comment: ['This is an action title to show the changes between local and remote version of resources'] }, "Open Changes"),
});
}
async run(accessor: ServicesAccessor, handle: TreeViewItemHandleArg): Promise<void> {
const editorService = accessor.get(IEditorService);
const { resource, comparableResource } = <{ resource: string, comparableResource: string }>JSON.parse(handle.$treeItemHandle);
const leftResource = URI.parse(resource);
const leftResourceName = localize({ key: 'leftResourceName', comment: ['remote as in file in cloud'] }, "{0} (Remote)", basename(leftResource));
const rightResource = URI.parse(comparableResource);
const rightResourceName = localize({ key: 'rightResourceName', comment: ['local as in file in disk'] }, "{0} (Local)", basename(rightResource));
await editorService.openEditor({
leftResource,
rightResource,
label: localize('sideBySideLabels', "{0} ↔ {1}", leftResourceName, rightResourceName),
description: localize('sideBySideDescription', "Settings Sync"),
options: {
preserveFocus: true,
revealIfVisible: true,
pinned: true
},
});
}
});
}
}
@@ -319,11 +293,13 @@ abstract class UserDataSyncActivityViewDataProvider implements ITreeViewDataProv
const associatedResources = await this.userDataSyncService.getAssociatedResources((<SyncResourceHandleTreeItem>element).syncResourceHandle.syncResource, (<SyncResourceHandleTreeItem>element).syncResourceHandle);
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));
return {
handle,
collapsibleState: TreeItemCollapsibleState.None,
resourceUri: resource,
command: { id: `workbench.actions.sync.compareWithLocal`, title: '', arguments: [<TreeViewItemHandleArg>{ $treeViewId: '', $treeItemHandle: handle }] },
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}`
};
});
@@ -363,7 +339,7 @@ class RemoteUserDataSyncActivityViewDataProvider extends UserDataSyncActivityVie
super(userDataSyncService, userDataAutoSyncService, userDataSyncWorkbenchService, notificationService);
}
async getChildren(element?: ITreeItem): Promise<ITreeItem[]> {
override async getChildren(element?: ITreeItem): Promise<ITreeItem[]> {
if (!element) {
this.machinesPromise = undefined;
}
@@ -381,7 +357,7 @@ class RemoteUserDataSyncActivityViewDataProvider extends UserDataSyncActivityVie
return this.userDataSyncService.getRemoteSyncResourceHandles(syncResource);
}
protected async getChildrenForSyncResourceTreeItem(element: SyncResourceHandleTreeItem): Promise<ITreeItem[]> {
protected override async getChildrenForSyncResourceTreeItem(element: SyncResourceHandleTreeItem): Promise<ITreeItem[]> {
const children = await super.getChildrenForSyncResourceTreeItem(element);
if (children.length) {
const machineId = await this.userDataSyncService.getMachineId(element.syncResourceHandle.syncResource, element.syncResourceHandle);

View File

@@ -7,7 +7,7 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWo
import { IUserDataSyncUtilService, SyncStatus, UserDataSyncError, UserDataSyncErrorCode, IUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataSync';
import { Registry } from 'vs/platform/registry/common/platform';
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services';
import { UserDataSycnUtilServiceChannel } from 'vs/platform/userDataSync/common/userDataSyncIpc';
import { registerAction2, Action2, MenuId } from 'vs/platform/actions/common/actions';
import { localize } from 'vs/nls';