This commit is contained in:
Noah Santschi-Cooney 2021-02-12 01:28:26 +00:00
parent 3dfaed7371
commit bbcfe009bb
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48
6 changed files with 20 additions and 13 deletions

View file

@ -82,8 +82,6 @@ export class Extension {
const exists = await fs.stat(dest).then(() => true, () => false)
if (!exists) await this.state.updateServerVersion(undefined)
this.state.updateServerVersion('borger')
const release = await getReleaseInfo(this.package.version)
const platform = platforms[`${process.arch} ${process.platform}`]
@ -94,7 +92,7 @@ export class Extension {
if (release.tag_name === this.state.serverVersion) return
const artifact = release.assets.find(artifact => artifact.name === `mcshader-lsp-${platform}`)
const artifact = release.assets.find(artifact => artifact.name === `mcshader-lsp-${platform}${(process.platform === 'win32' ? '.exe' : '')}`)
const userResponse = await vscode.window.showInformationMessage(
this.state.serverVersion == undefined ?

View file

@ -11,8 +11,9 @@ export class LanguageClient extends lsp.LanguageClient {
constructor(ext: Extension) {
super('vscode-mc-shader', 'VSCode MC Shader', {
command: process.env['MCSHADER_DEBUG'] ?
ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'mcshader-lsp')) :
path.join(ext.context.globalStoragePath, 'mcshader-lsp')
ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'mcshader-lsp')) +
(process.platform === 'win32' ? '.exe' : '') :
path.join(ext.context.globalStoragePath, 'mcshader-lsp')
}, {
documentSelector: [{scheme: 'file', language: 'glsl'}],
outputChannel: lspOutputChannel,

View file

@ -7,9 +7,10 @@ export class PersistentState {
log.info('working with state', { serverVersion })
}
get serverVersion(): string | undefined {
public get serverVersion(): string | undefined {
return this.state.get('serverVersion')
}
async updateServerVersion(value: string | undefined) {
await this.state.update('serverVersion', value)
}