mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Add 'key' to onDidChange of secrets API, #112249
This commit is contained in:
@@ -14,15 +14,19 @@ export class ExtensionSecrets implements vscode.SecretStorage {
|
||||
protected readonly _id: string;
|
||||
protected readonly _secretState: ExtHostSecretState;
|
||||
|
||||
private _onDidChange = new Emitter<void>();
|
||||
readonly onDidChange: Event<void> = this._onDidChange.event;
|
||||
private _onDidChange = new Emitter<vscode.SecretStorageChangeEvent>();
|
||||
readonly onDidChange: Event<vscode.SecretStorageChangeEvent> = this._onDidChange.event;
|
||||
|
||||
|
||||
constructor(extensionDescription: IExtensionDescription, secretState: ExtHostSecretState) {
|
||||
this._id = ExtensionIdentifier.toKey(extensionDescription.identifier);
|
||||
this._secretState = secretState;
|
||||
|
||||
this._secretState.onDidChangePassword(_ => this._onDidChange.fire());
|
||||
this._secretState.onDidChangePassword(e => {
|
||||
if (e.extensionId === this._id) {
|
||||
this._onDidChange.fire({ key: e.key });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
get(key: string): Promise<string | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user