back to the shorter var name

This commit is contained in:
Noah Santschi-Cooney 2018-06-15 23:01:09 +01:00
parent ef643d8cdb
commit d8e374496b
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48
3 changed files with 7 additions and 7 deletions

View file

@ -1,11 +1,11 @@
import { join } from 'path' import { join } from 'path'
export class Config { export class Config {
public minecraftPath: string public readonly minecraftPath: string
public glslangValidatorPath: string public readonly glslangPath: string
constructor(mcPath: string, glslangPath: string) { constructor(mcPath: string, glslangPath: string) {
this.minecraftPath = join(mcPath, 'shaderpacks') this.minecraftPath = join(mcPath, 'shaderpacks')
this.glslangValidatorPath = glslangPath || 'glslangValidator' this.glslangPath = glslangPath || 'glslangValidator'
} }
} }

View file

@ -75,7 +75,7 @@ export function preprocess(document: TextDocument) {
} }
function lint(text: string, uri: string) { 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 diagnostics: Diagnostic[] = []
const matches = filterMatches(out) as RegExpMatchArray[] const matches = filterMatches(out) as RegExpMatchArray[]
matches.forEach((match) => { matches.forEach((match) => {

View file

@ -36,10 +36,10 @@ documents.onDidSave((event) => {
connection.onDidChangeConfiguration((change) => { connection.onDidChangeConfiguration((change) => {
const temp = change.settings.mcglsl as Config const temp = change.settings.mcglsl as Config
conf = new Config(temp.minecraftPath, temp.glslangValidatorPath) conf = new Config(temp['minecraftPath'], temp['glslangValidatorPath'])
exec(conf.glslangValidatorPath, (error) => { exec(conf.glslangPath, (error) => {
if (error['code'] !== 1) { 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 return
} }
documents.all().forEach(preprocess); documents.all().forEach(preprocess);