diff --git a/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts b/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts index 0fc0c81319..52709d4a0b 100644 --- a/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts +++ b/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts @@ -2,19 +2,36 @@ * Keyman is copyright (C) SIL Global. MIT License. */ -// import { NodeCompilerCallbacks } from "@keymanapp/kmc"; +import { NodeCompilerCallbacks } from "@keymanapp/kmc/build/src/util/NodeCompilerCallbacks.js"; import { LDMLCompilerManager } from "./ldmlCompilerManager.js"; +import { CompilerCallbackOptions } from "@keymanapp/developer-utils"; +import { LdmlCompilerOptions, LdmlKeyboardCompiler } from "@keymanapp/kmc-ldml"; /** * TODO-LDML-EDITOR: should use vscode.workspace.fs.readFile which can read from remote workspaces. */ export class KmcLdmlManager implements LDMLCompilerManager { + calloptions?: CompilerCallbackOptions; + callbacks?: NodeCompilerCallbacks; + compoptions?: LdmlCompilerOptions; + async init(): Promise { console.log("Initting KmcLdmlManager…"); - // new NodeCompilerCallbacks({ - // }); + this.calloptions = { + logLevel: "debug" + }; + this.callbacks = new NodeCompilerCallbacks(this.calloptions); console.log("KmcLdmlManager okay!"); + const k = new LdmlKeyboardCompiler(); + this.compoptions = { + readerOptions: { + importsPath: "/Users/srl295/src/cldr/keyboards/import/", + } + }; + await k.init(this.callbacks, this.compoptions); + // await k.compile(); + console.log('Initted'); } };