From b2167fe43d9325a2edaaa83053417d094b1b8005 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 24 Dec 2024 07:54:56 -0600 Subject: [PATCH] chore(developer): update for update from master - use correct imports paths - user gets a fatal error if the keyboard file doesn't compile. But at least it compiles! Fixes: #12789 --- .../src/vscode-plugin/src/kmcLdmlCompilerManager.mts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts b/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts index 7ffd930d92..2f541cc8da 100644 --- a/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts +++ b/developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts @@ -3,10 +3,13 @@ */ import { LDMLCompilerManager } from "./ldmlCompilerManager.js"; -import { CompilerCallbackOptions, CompilerCallbacks, defaultCompilerOptions } from "@keymanapp/developer-utils"; +import { CompilerCallbackOptions, CompilerCallbacks, defaultCompilerOptions, LDMLKeyboardXMLSourceFileReader } from "@keymanapp/developer-utils"; import { LdmlCompilerOptions, LdmlKeyboardCompiler } from "@keymanapp/kmc-ldml"; import { ExtensionCallbacks } from "./extensionCallbacks.mjs"; import { KMXPlus } from "@keymanapp/common-types"; +import { fileURLToPath } from 'url'; +import { dirname } from 'node:path'; + /** * TODO-LDML-EDITOR: should use vscode.workspace.fs.readFile which can read from remote workspaces. * @@ -39,8 +42,8 @@ export class KmcLdmlManager implements LDMLCompilerManager { this.compoptions = { ...defaultCompilerOptions, readerOptions: { - // TODO-EPIC-LDML: need to use global path - importsPath: "/Users/srl295/src/cldr/keyboards/import/", + cldrImportsPath: fileURLToPath(new URL(...LDMLKeyboardXMLSourceFileReader.defaultImportsURL)), + localImportsPaths: [ dirname(filename) ], // local dir } }; await k.init(this.callbacks, this.compoptions);