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

Function applyOptions

src/lib/editorManager.js:689–707  ·  view source on GitHub ↗
(keys)

Source from the content-addressed store, hash-verified

687 }
688
689 function applyOptions(keys) {
690 const filter = keys ? new Set(keys) : null;
691 for (const spec of cmOptionSpecs) {
692 if (filter && !spec.keys.some((k) => filter.has(k))) continue;
693 const built = spec.build();
694 const effects = [];
695 if (spec.compartments.length === 1) {
696 effects.push(spec.compartments[0].reconfigure(built));
697 } else {
698 const arr = Array.isArray(built) ? built : [built];
699 for (let i = 0; i < spec.compartments.length; i++) {
700 const comp = spec.compartments[i];
701 const ext = arr[i] ?? [];
702 effects.push(comp.reconfigure(ext));
703 }
704 }
705 editor.dispatch({ effects });
706 }
707 }
708
709 function buildLspMetadata(file) {
710 if (!file || file.type !== "editor") return null;

Calls

no outgoing calls

Tested by

no test coverage detected