Web-Ide mit aufgenommen

This commit is contained in:
Riwoldt
2026-04-09 14:14:56 +02:00
parent 64816c45cc
commit 15cfaf332d
489 changed files with 186891 additions and 0 deletions
@@ -0,0 +1,23 @@
import type { TST } from "@nand2tetris/simulator/languages/tst";
import { Diagnostic, TextDocument, Uri } from "vscode";
import * as base from "./base.js";
let tst: typeof TST | undefined = undefined;
async function getTst(): Promise<typeof TST> {
if (tst) return Promise.resolve(tst);
tst = (await import("@nand2tetris/simulator/languages/tst.js"))
.TST as typeof TST;
return tst;
}
export async function getDiagnostics(
document: TextDocument,
): Promise<[Uri, Diagnostic[]][]> {
try {
const { parser } = await getTst();
return base.getDiagnostics(document, parser);
} catch (e) {
console.error("Failed to load tst parser", e);
return [];
}
}