mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-19 09:15:54 +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'
|
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'
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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) => {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue