MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / addSingleFile

Method addSingleFile

static/panes/tree.ts:625–641  ·  view source on GitHub ↗
(htmlfile)

Source from the content-addressed store, hash-verified

623 }
624
625 private async addSingleFile(htmlfile): Promise<void> {
626 try {
627 await this.askForOverwriteAndDo(htmlfile.name);
628
629 return new Promise(resolve => {
630 const fr = new FileReader();
631 fr.onload = () => {
632 this.multifileService.addNewTextFile(htmlfile.name, fr.result?.toString() || '');
633 this.refresh();
634 resolve();
635 };
636 fr.readAsText(htmlfile);
637 });
638 } catch {
639 // expected when user says no
640 }
641 }
642
643 private numberUsedLines() {
644 if (_.any(this.busyCompilers)) return;

Callers 1

initButtonsMethod · 0.95

Calls 4

askForOverwriteAndDoMethod · 0.95
refreshMethod · 0.95
addNewTextFileMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected