Config should be complete. Added 'shaderpacks' to end of mc path, passing correct object now too

This commit is contained in:
Noah Santschi-Cooney 2018-06-06 22:47:08 +01:00
parent 513606542e
commit 7775b75411
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48
5 changed files with 337 additions and 4 deletions

View file

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

View file

@ -1,4 +1,5 @@
import * as vsclang from 'vscode-languageserver'
import { conf } from './server'
export function preprocess(document: vsclang.TextDocument) {
return

View file

@ -9,7 +9,7 @@ const documents = new vsclang.TextDocuments();
documents.listen(connection);
const conf = new Config('', '')
export const conf = new Config('', '')
connection.onInitialize((params): vsclang.InitializeResult => {
return {
@ -27,7 +27,7 @@ documents.onDidChangeContent((change) => {
});
connection.onDidChangeConfiguration((change) => {
conf.onChange(change.settings as Config)
conf.onChange(change.settings.mcglsl as Config)
documents.all().forEach(preprocess);
});