Move lsp server to this repo (#5619)
This commit is contained in:
21
rust/kcl-language-server/client/src/persistent_state.ts
Normal file
21
rust/kcl-language-server/client/src/persistent_state.ts
Normal file
@ -0,0 +1,21 @@
|
||||
/* eslint suggest-no-throw/suggest-no-throw: 0 */
|
||||
import type * as vscode from 'vscode'
|
||||
import { log } from './util'
|
||||
|
||||
export class PersistentState {
|
||||
constructor(private readonly globalState: vscode.Memento) {
|
||||
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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user