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

Function getBaseExtensionsFromOptions

src/lib/editorManager.js:642–659  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

640 ];
641
642 function getBaseExtensionsFromOptions() {
643 /** @type {import("@codemirror/state").Extension[]} */
644 const exts = [];
645 for (const spec of cmOptionSpecs) {
646 const built = spec.build();
647 if (spec.compartments.length === 1) {
648 exts.push(spec.compartments[0].of(built));
649 } else {
650 const arr = Array.isArray(built) ? built : [built];
651 for (let i = 0; i < spec.compartments.length; i++) {
652 const comp = spec.compartments[i];
653 const ext = arr[i];
654 if (ext !== undefined) exts.push(comp.of(ext));
655 }
656 }
657 }
658 return exts;
659 }
660
661 function createEmmetExtensionSet({
662 syntax,

Callers 3

EditorManagerFunction · 0.85
showLoadingEditorFunction · 0.85
applyFileToEditorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected