MCPcopy Index your code
hub / github.com/nwutils/nw-sample-apps / readFileIntoEditor

Function readFileIntoEditor

mini-code-edit/editor.js:53–62  ·  view source on GitHub ↗
(theFileEntry)

Source from the content-addressed store, hash-verified

51}
52
53function readFileIntoEditor(theFileEntry) {
54 fs.readFile(theFileEntry, function (err, data) {
55 if (err) {
56 console.log("Read failed: " + err);
57 }
58
59 handleDocumentChange(theFileEntry);
60 editor.setValue(String(data));
61 });
62}
63
64function writeEditorToFile(theFileEntry) {
65 var str = editor.getValue();

Callers 1

onChosenFileToOpenFunction · 0.85

Calls 1

handleDocumentChangeFunction · 0.85

Tested by

no test coverage detected