mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-19 01:05:29 +00:00
back to the shorter var name
This commit is contained in:
parent
ef643d8cdb
commit
d8e374496b
3 changed files with 7 additions and 7 deletions
|
@ -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'
|
||||
}
|
||||
}
|
|
@ -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) => {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue