rust/editors/code/src/persistent_state.ts

21 lines
644 B
TypeScript
Raw Normal View History

import type * as vscode from "vscode";
2022-05-17 12:15:06 -05:00
import { log } from "./util";
export class PersistentState {
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);
}
}