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

Function registerExternalCommand

src/cm/commandRegistry.js:1619–1636  ·  view source on GitHub ↗
(descriptor = {})

Source from the content-addressed store, hash-verified

1617export { commandKeymapCompartment };
1618
1619export function registerExternalCommand(descriptor = {}) {
1620 const normalized = normalizeExternalCommand(descriptor);
1621 if (!normalized) return null;
1622
1623 const { name } = normalized;
1624 if (commandMap.has(name)) {
1625 commandMap.delete(name);
1626 }
1627
1628 addCommand(normalized);
1629 const stored = commandMap.get(name);
1630 if (stored) {
1631 stored.key = normalized.key ?? stored.key;
1632 }
1633
1634 rebuildKeymap();
1635 return stored;
1636}
1637
1638export function removeExternalCommand(name) {
1639 if (!name) return false;

Callers 2

addCommandMethod · 0.90
addCommandFunction · 0.90

Calls 5

normalizeExternalCommandFunction · 0.85
rebuildKeymapFunction · 0.85
addCommandFunction · 0.70
deleteMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected