mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Use ref instead of version
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user