Adds Memento.keys #87110

This commit is contained in:
Eric Amodio
2021-05-18 16:38:27 -04:00
parent 25873bb34c
commit 9b1ba3f31f
2 changed files with 17 additions and 0 deletions

View File

@@ -56,6 +56,11 @@ export class ExtensionMemento implements vscode.Memento {
}, 0);
}
get keys(): readonly string[] {
// Filter out `undefined` values, as they can stick around in the `_value` until the `onDidChangeStorage` event runs
return Object.entries(this._value ?? {}).filter(([, value]) => value !== undefined).map(([key]) => key);
}
get whenReady(): Promise<ExtensionMemento> {
return this._init;
}