MCPcopy Index your code
hub / github.com/Acode-Foundation/Acode / executeCommand

Function executeCommand

src/cm/commandRegistry.js:1540–1555  ·  view source on GitHub ↗
(name, view, args)

Source from the content-addressed store, hash-verified

1538}
1539
1540export function executeCommand(name, view, args) {
1541 const command = resolveCommand(name);
1542 if (!command) return false;
1543 const targetView = command.requiresView
1544 ? resolveView(view)
1545 : resolveView(view) || null;
1546 if (command.requiresView && !targetView) return false;
1547 if (!commandRunsInReadOnly(command, targetView)) return false;
1548 try {
1549 const result = command.run(targetView, args);
1550 return result !== false;
1551 } catch (error) {
1552 console.error(`Failed to execute command ${name}`, error);
1553 return false;
1554 }
1555}
1556
1557export function getRegisteredCommands() {
1558 return Array.from(commandMap.values()).map((command) => ({

Callers 5

onselectFunction · 0.90
EditorManagerFunction · 0.90
actionsFunction · 0.90
rebuildKeymapFunction · 0.70

Calls 5

resolveCommandFunction · 0.85
resolveViewFunction · 0.85
commandRunsInReadOnlyFunction · 0.85
runMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected