Add 'key' to onDidChange of secrets API, #112249

This commit is contained in:
Rachel Macfarlane
2021-01-15 17:08:09 -08:00
parent c5f0bac2a8
commit 2e89c2d4ba
10 changed files with 43 additions and 23 deletions

View File

@@ -4,21 +4,21 @@
*--------------------------------------------------------------------------------------------*/
import { ExtHostSecretStateShape, MainContext, MainThreadSecretStateShape } from 'vs/workbench/api/common/extHost.protocol';
import { Emitter, Event } from 'vs/base/common/event';
import { Emitter } from 'vs/base/common/event';
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
export class ExtHostSecretState implements ExtHostSecretStateShape {
private _proxy: MainThreadSecretStateShape;
private _onDidChangePassword = new Emitter<void>();
readonly onDidChangePassword: Event<void> = this._onDidChangePassword.event;
private _onDidChangePassword = new Emitter<{ extensionId: string, key: string }>();
readonly onDidChangePassword = this._onDidChangePassword.event;
constructor(mainContext: IExtHostRpcService) {
this._proxy = mainContext.getProxy(MainContext.MainThreadSecretState);
}
async $onDidChangePassword(): Promise<void> {
this._onDidChangePassword.fire();
async $onDidChangePassword(e: { extensionId: string, key: string }): Promise<void> {
this._onDidChangePassword.fire(e);
}
get(extensionId: string, key: string): Promise<string | undefined> {