From d8e374496b1fa11b7fbab7bb1344fb86cbbb75b4 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Fri, 15 Jun 2018 23:01:09 +0100 Subject: [PATCH] back to the shorter var name --- server/src/config.ts | 6 +++--- server/src/linter.ts | 2 +- server/src/server.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/config.ts b/server/src/config.ts index 73c454d..6d375fa 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -1,11 +1,11 @@ import { join } from 'path' export class Config { - public minecraftPath: string - public glslangValidatorPath: string + public readonly minecraftPath: string + public readonly glslangPath: string constructor(mcPath: string, glslangPath: string) { this.minecraftPath = join(mcPath, 'shaderpacks') - this.glslangValidatorPath = glslangPath || 'glslangValidator' + this.glslangPath = glslangPath || 'glslangValidator' } } \ No newline at end of file diff --git a/server/src/linter.ts b/server/src/linter.ts index f709a10..b1441ce 100644 --- a/server/src/linter.ts +++ b/server/src/linter.ts @@ -75,7 +75,7 @@ export function preprocess(document: TextDocument) { } function lint(text: string, uri: string) { - const child = exec(`${conf.glslangValidatorPath} --stdin -S frag`, (error, out, err) => { + const child = exec(`${conf.glslangPath} --stdin -S frag`, (error, out, err) => { const diagnostics: Diagnostic[] = [] const matches = filterMatches(out) as RegExpMatchArray[] matches.forEach((match) => { diff --git a/server/src/server.ts b/server/src/server.ts index c5e99da..c591def 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -36,10 +36,10 @@ documents.onDidSave((event) => { connection.onDidChangeConfiguration((change) => { const temp = change.settings.mcglsl as Config - conf = new Config(temp.minecraftPath, temp.glslangValidatorPath) - exec(conf.glslangValidatorPath, (error) => { + conf = new Config(temp['minecraftPath'], temp['glslangValidatorPath']) + exec(conf.glslangPath, (error) => { if (error['code'] !== 1) { - connection.window.showErrorMessage(`[mc-glsl] glslangValidator not found at: ${conf.glslangValidatorPath}`) + connection.window.showErrorMessage(`[mc-glsl] glslangValidator not found at: ${conf.glslangPath}`) return } documents.all().forEach(preprocess);