Skip to content

Commit

Permalink
Merge pull request #398 from moonbitlang/zhiyuan/update-moonpad
Browse files Browse the repository at this point in the history
upgrade moonpad
  • Loading branch information
bzy-debug authored Jan 3, 2025
2 parents 387a83e + e177812 commit 5da85fa
Show file tree
Hide file tree
Showing 3 changed files with 263 additions and 9 deletions.
2 changes: 1 addition & 1 deletion moonbit-tour/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"vite": "^6.0.1"
},
"dependencies": {
"@moonbit/moonpad-monaco": "^0.1.202501023",
"@moonbit/moonpad-monaco": "^0.1.202501030",
"monaco-editor-core": "^0.52.0"
}
}
9 changes: 6 additions & 3 deletions moonbit-tour/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ function debounce<P extends any[], R>(f: (...args: P) => R, timeout: number) {

const codePre = document.querySelector<HTMLPreElement>(".shiki")!;

const model = monaco.editor.createModel(codePre.textContent ?? "", "moonbit");
const model = monaco.editor.createModel(
codePre.textContent ?? "",
"moonbit",
monaco.Uri.file("/main.mbt"),
);

const output = document.querySelector<HTMLPreElement>("#output")!;

async function run(debug: boolean) {
const content = model.getValue();
const result = await moon.compile({
libContents: [content],
libUris: [monaco.Uri.file("/main.mbt").toString()],
debugMain: debug,
});
switch (result.kind) {
Expand Down
Loading

0 comments on commit 5da85fa

Please sign in to comment.