Files
Codesys-MCP/vscode_codesys_companion/src/state.ts

16 lines
454 B
TypeScript

import * as vscode from "vscode";
const ACTIVE_PROJECT_KEY = "codesys.activeProjectPath";
export class ExtensionState {
constructor(private readonly context: vscode.ExtensionContext) {}
public get activeProjectPath(): string {
return this.context.globalState.get<string>(ACTIVE_PROJECT_KEY, "");
}
public async setActiveProjectPath(path: string): Promise<void> {
await this.context.globalState.update(ACTIVE_PROJECT_KEY, path);
}
}