Skip to content

Commit

Permalink
chore(developer): update for update from master
Browse files Browse the repository at this point in the history
- use correct imports paths
- user gets a fatal error if the keyboard file doesn't compile. But at least it compiles!

Fixes: #12789
  • Loading branch information
srl295 committed Dec 24, 2024
1 parent d77c19f commit b2167fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions developer/src/vscode-plugin/src/kmcLdmlCompilerManager.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b2167fe

Please sign in to comment.