2023-07-10 16:10:00 -05:00
|
|
|
import type * as vscode from "vscode";
|
2020-03-17 06:44:31 -05:00
|
|
|
import { log } from "./util";
|
2020-03-16 13:23:38 -05:00
|
|
|
|
|
|
|
export class PersistentState {
|
2020-03-17 06:44:31 -05:00
|
|
|
constructor(private readonly globalState: vscode.Memento) {
|
2021-12-23 00:44:23 -06:00
|
|
|
const { serverVersion } = this;
|
|
|
|
log.info("PersistentState:", { serverVersion });
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Version of the extension that installed the server.
|
|
|
|
* Used to check if we need to run patchelf again on NixOS.
|
|
|
|
*/
|
|
|
|
get serverVersion(): string | undefined {
|
|
|
|
return this.globalState.get("serverVersion");
|
|
|
|
}
|
|
|
|
async updateServerVersion(value: string | undefined) {
|
|
|
|
await this.globalState.update("serverVersion", value);
|
2020-09-23 01:12:51 -05:00
|
|
|
}
|
2020-03-16 13:23:38 -05:00
|
|
|
}
|