mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-24 11:44:44 +00:00
Config should be complete. Added 'shaderpacks' to end of mc path, passing correct object now too
This commit is contained in:
parent
513606542e
commit
7775b75411
5 changed files with 337 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import * as vsclang from 'vscode-languageserver'
|
||||
import { conf } from './server'
|
||||
|
||||
export function preprocess(document: vsclang.TextDocument) {
|
||||
return
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue