mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-08-29 04:54:15 +00:00
Probably the last time i need to revise checking if binary exists. Bit annoying that windows returns 1 if it doesnt exist
This commit is contained in:
parent
bd546ab67f
commit
5e6a12c88b
2 changed files with 4 additions and 3 deletions
|
@ -1,9 +1,10 @@
|
|||
import { connection, documents, onEvent } from './server'
|
||||
import fetch from 'node-fetch'
|
||||
import { platform } from 'os'
|
||||
import { createWriteStream, chmodSync, createReadStream, unlinkSync, existsSync } from 'fs'
|
||||
import { createWriteStream, chmodSync, createReadStream, unlinkSync } from 'fs'
|
||||
import * as unzip from 'unzip'
|
||||
import { postError } from './utils'
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
const url = {
|
||||
'win32': 'https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip',
|
||||
|
@ -22,7 +23,7 @@ export const onConfigChange = async (change) => {
|
|||
const temp = change.settings.mcglsl as Config
|
||||
conf = {shaderpacksPath: temp['shaderpacksPath'].replace(/\\/g, '/'), glslangPath: temp['glslangValidatorPath'].replace(/\\/g, '/')}
|
||||
|
||||
if (existsSync(conf.glslangPath)) {
|
||||
if (!execSync(conf.glslangPath).toString().startsWith('Usage')) {
|
||||
documents.all().forEach(onEvent)
|
||||
} else {
|
||||
promptDownloadGlslang()
|
||||
|
|
|
@ -223,7 +223,7 @@ function lint(uri: string, lines: string[], includes: Map<string, IncludeObj>, d
|
|||
// TODO what if we dont know the top level parent? Feel like thats a non-issue given that we have uri
|
||||
diag = {
|
||||
severity: errorType(type),
|
||||
range: calcRange(includes.get(nextFile).lineNum - (win ? 1 : 0), includes.get(nextFile).parent),
|
||||
range: calcRange(includes.get(nextFile).lineNum - 1, includes.get(nextFile).parent),
|
||||
message: includes.get(file).path.replace(conf.shaderpacksPath, '') + replaceWords(msg),
|
||||
source: 'mc-glsl'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue