diff --git a/src/index.ts b/src/index.ts index 3b597c9..c4b27a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -129,19 +129,26 @@ return xstring; var file = document.createElement('a'); file.setAttribute('href', 'data:application/octet-stream;base64,' + Buffer.from(res.get(), "hex").toString("base64")); - file.setAttribute('download', "foo.xlsx"); + file.setAttribute('download', "abap2xlsx " + new Date().toISOString() + ".xlsx"); file.innerText = "Download, " + (res.get().length / 2) + " bytes"; document.getElementById("container2").appendChild(file); } +let tid = 0; async function abapChanged() { + clearTimeout(tid); + tid = setTimeout(async () => updateEverything(), 800); +} + +async function updateEverything() { // @ts-ignore console.dir(globalThis.abap); const contents = editor1.getValue(); + const file = new abaplint.MemoryFile(filename, contents); + reg.updateFile(file); + try { - const file = new abaplint.MemoryFile(filename, contents); - reg.updateFile(file); reg.parse(); abapMonaco.updateMarkers(reg, model1);