Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Sep 10, 2019
1 parent cae7f1c commit cc0f391
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
14 changes: 1 addition & 13 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,7 @@ declare module 'vscode' {

export namespace window {

export function registerUserLoginProvider(userDataId: string, userLoginProvider: UserLoginProvider): Disposable;

export function registerUserDataProvider(userDataId: string, userDataProvider: UserDataProvider): Disposable;
export function registerUserDataProvider(name: string, userDataProvider: UserDataProvider): Disposable;

}

Expand All @@ -1005,15 +1003,5 @@ declare module 'vscode' {

}

export interface UserLoginProvider {

isLoggedin(): boolean;

readonly onDidChange: Event<void>;

login(): Promise<void>;

}

//#endregion
}
6 changes: 1 addition & 5 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostWindow = rpcProtocol.set(ExtHostContext.ExtHostWindow, new ExtHostWindow(rpcProtocol));
const extHostProgress = rpcProtocol.set(ExtHostContext.ExtHostProgress, new ExtHostProgress(rpcProtocol.getProxy(MainContext.MainThreadProgress)));
const extHostLabelService = rpcProtocol.set(ExtHostContext.ExtHosLabelService, new ExtHostLabelService(rpcProtocol));
const extHostUserData = rpcProtocol.set(ExtHostContext.ExtHostUserData, new ExtHostUserData(rpcProtocol.getProxy(MainContext.MainThreadUserData), extHostFileSystem));
const extHostUserData = rpcProtocol.set(ExtHostContext.ExtHostUserData, new ExtHostUserData(rpcProtocol.getProxy(MainContext.MainThreadUserData), extHostLogService));

// Check that no named customers are missing
const expected: ProxyIdentifier<any>[] = values(ExtHostContext);
Expand Down Expand Up @@ -541,10 +541,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
registerUserDataProvider: (identity: string, userDataProvider: vscode.UserDataProvider): vscode.Disposable => {
checkProposedApiEnabled(extension);
return extHostUserData.registerUserDataProvider(identity, userDataProvider);
},
registerUserLoginProvider: (identity: string, userLoginProvider: vscode.UserLoginProvider): vscode.Disposable => {
checkProposedApiEnabled(extension);
return extHostUserData.registerUserLoginProvider(identity, userLoginProvider);
}
};

Expand Down
8 changes: 8 additions & 0 deletions src/vs/workbench/services/userData/common/settingsSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ import { setProperty } from 'vs/base/common/jsonEdit';
import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { EditOperation } from 'vs/editor/common/core/editOperation';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';

export const ISettingsSyncService = createDecorator<ISettingsSyncService>('ISettingsSyncService');

export interface ISettingsSyncService {
_serviceBrand: undefined;
sync(): Promise<void>;
}

Expand All @@ -39,6 +44,7 @@ interface ISyncPreviewResult {
}

export class SettingsSyncService extends Disposable implements ISettingsSyncService, ITextModelContentProvider {
_serviceBrand: undefined;

private static LAST_SYNC_SETTINGS_STORAGE_KEY: string = 'LAST_SYNC_SETTINGS_CONTENTS';
private static EXTERNAL_USER_DATA_SETTINGS_KEY: string = 'settings';
Expand Down Expand Up @@ -402,3 +408,5 @@ export class SettingsSyncService extends Disposable implements ISettingsSyncServ
}

}

registerSingleton(ISettingsSyncService, SettingsSyncService);
15 changes: 8 additions & 7 deletions src/vs/workbench/services/userData/common/userDataSyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IUserDataSyncService, IUserDataProviderService, IUserDataExtension, SyncStatus } from 'vs/workbench/services/userData/common/userData';
import { IUserDataSyncService, SyncStatus, IRemoteUserDataService } from 'vs/workbench/services/userData/common/userData';
import { Disposable } from 'vs/base/common/lifecycle';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Emitter, Event } from 'vs/base/common/event';
import { timeout } from 'vs/base/common/async';
import { ISettingsSyncService } from 'vs/workbench/services/userData/common/settingsSync';

export class UserDataSyncService extends Disposable implements IUserDataSyncService {

Expand All @@ -28,21 +28,22 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ
}

constructor(
@IUserDataProviderService private readonly userDataProviderService: IUserDataProviderService
@IRemoteUserDataService private readonly remoteUserDataService: IRemoteUserDataService,
@ISettingsSyncService private readonly settingsSyncService: ISettingsSyncService
) {
super();
}


async synchronise(): Promise<void> {
if (!this.remoteUserDataService.isEnabled()) {
throw new Error('Not enabled');
}
this.syncStatus = SyncStatus.Syncing;
await timeout(5000);
await this.settingsSyncService.sync();
this.syncStatus = SyncStatus.SyncDone;
}

getExtensions(): Promise<IUserDataExtension[]> {
return Promise.resolve([]);
}

}

Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/workbench.common.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ import 'vs/workbench/services/label/common/labelService';
import 'vs/workbench/services/extensionManagement/common/extensionEnablementService';
import 'vs/workbench/services/notification/common/notificationService';
import 'vs/workbench/services/extensions/common/staticExtensions';
import 'vs/workbench/services/userData/common/userIdentityService';
import 'vs/workbench/services/userData/common/userDataProviderService';
import 'vs/workbench/services/userData/common/remoteUserDataService';
import 'vs/workbench/services/userData/common/userDataSyncService';
import 'vs/workbench/services/userData/common/settingsSync';

import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService';
Expand Down

0 comments on commit cc0f391

Please sign in to comment.