Use ref instead of version

This commit is contained in:
Sandeep Somavarapu
2019-09-12 16:17:05 +02:00
parent eb55f59c93
commit 88e5a183ae
7 changed files with 24 additions and 24 deletions

View File

@@ -755,7 +755,7 @@ export interface ExtHostConfigurationShape {
export interface ExtHostUserDataShape {
$read(key: string): Promise<IUserData | null>;
$write(key: string, version: number, content: string): Promise<void>;
$write(key: string, content: string, ref: string): Promise<string>;
}
export interface ExtHostDiagnosticsShape {

View File

@@ -2372,8 +2372,8 @@ export class Decoration {
@es5ClassCompat
export class UserDataError extends Error {
static VersionExists(message?: string): UserDataError {
return new UserDataError(message, RemoteUserDataErrorCode.VersionExists);
static Rejected(message?: string): UserDataError {
return new UserDataError(message, RemoteUserDataErrorCode.Rejected);
}
constructor(message?: string, code: RemoteUserDataErrorCode = RemoteUserDataErrorCode.Unknown) {

View File

@@ -38,11 +38,11 @@ export class ExtHostUserData implements ExtHostUserDataShape {
return this.userDataProvider.read(key);
}
$write(key: string, version: number, content: string): Promise<void> {
$write(key: string, content: string, ref: string): Promise<string> {
if (!this.userDataProvider) {
throw new Error('No remote user data provider exists.');
}
return this.userDataProvider.write(key, version, content);
return this.userDataProvider.write(key, content, ref);
}
}