Skip to content

Commit

Permalink
adjust filename + throttle (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp authored Sep 9, 2024
1 parent a8f85a4 commit 3a0e3f6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3a0e3f6

Please sign in to comment.