MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / addFile

Function addFile

src/lib/editorManager.js:2222–2233  ·  view source on GitHub ↗

* Adds a file to the manager's file list and updates the UI. * @param {File} file - The file to be added.

(file)

Source from the content-addressed store, hash-verified

2220 * @param {File} file - The file to be added.
2221 */
2222 function addFile(file) {
2223 if (manager.files.includes(file)) return;
2224 const insertAt = file.pinned
2225 ? getPinnedInsertIndex()
2226 : manager.files.length;
2227 manager.files.splice(insertAt, 0, file);
2228 syncOpenFileList();
2229 if (!manager.activeFile) {
2230 $header.text = file.name;
2231 }
2232 toggleProblemButton();
2233 }
2234
2235 function getPinnedInsertIndex(skipFile = null) {
2236 return manager.files.reduce((count, file) => {

Callers

nothing calls this directly

Calls 3

getPinnedInsertIndexFunction · 0.85
syncOpenFileListFunction · 0.85
toggleProblemButtonFunction · 0.85

Tested by

no test coverage detected