MCPcopy Index your code
hub / github.com/hokein/electron-sample-apps / readFileIntoEditor

Function readFileIntoEditor

mini-code-editor/editor.js:46–55  ·  view source on GitHub ↗
(theFileEntry)

Source from the content-addressed store, hash-verified

44}
45
46function readFileIntoEditor(theFileEntry) {
47 fs.readFile(theFileEntry.toString(), function (err, data) {
48 if (err) {
49 console.log("Read failed: " + err);
50 }
51
52 handleDocumentChange(theFileEntry);
53 editor.setValue(String(data));
54 });
55}
56
57function writeEditorToFile(theFileEntry) {
58 var str = editor.getValue();

Callers 1

onChosenFileToOpenFunction · 0.85

Calls 1

handleDocumentChangeFunction · 0.85

Tested by

no test coverage detected