Skip to content

Commit a172a42

Browse files
authored
Ensure default persistent values get persisted (#13074)
1 parent 5c684a8 commit a172a42

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Extension/src/LanguageServer/persistentState.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class PersistentStateBase<T> {
1919
this.defaultvalue = defaultValue;
2020
this.state = state;
2121
this.curvalue = defaultValue;
22+
23+
// Ensure the default is written to the state store.
24+
if (this.state && this.state.get<T>(this.key) === undefined) {
25+
void this.state.update(this.key, this.defaultvalue);
26+
}
2227
}
2328

2429
public get Value(): T {

0 commit comments

Comments
 (0)