Fixes #127439: changes keys to a function

This commit is contained in:
Eric Amodio 2021-06-30 18:01:57 -04:00
parent d136153476
commit 3cca828813
2 changed files with 5 additions and 3 deletions

6
src/vs/vscode.d.ts vendored
View file

@ -6215,9 +6215,11 @@ declare module 'vscode' {
export interface Memento {
/**
* The stored keys.
* Returns the stored keys.
*
* @return The stored keys.
*/
readonly keys: readonly string[];
keys(): readonly string[];
/**
* Return a value.

View file

@ -56,7 +56,7 @@ export class ExtensionMemento implements vscode.Memento {
}, 0);
}
get keys(): readonly string[] {
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);
}