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

Function executeCommand

src/cm/lsp/codeActions.ts:126–148  ·  view source on GitHub ↗
(
	plugin: LSPPlugin,
	command: Command,
)

Source from the content-addressed store, hash-verified

124}
125
126async function executeCommand(
127 plugin: LSPPlugin,
128 command: Command,
129): Promise<boolean> {
130 try {
131 await plugin.client.request<
132 { command: string; arguments?: unknown[] },
133 unknown
134 >("workspace/executeCommand", {
135 command: command.command,
136 arguments: command.arguments,
137 });
138 return true;
139 } catch (error) {
140 // -32601 = Method not implemented (expected for some LSP servers)
141 const lspError = error as { code?: number };
142 if (lspError?.code !== -32601) {
143 addLspLogFor(plugin, "warn", "Code action command execution failed", error);
144 console.warn("[LSP:CodeAction] Command execution failed:", error);
145 }
146 return false;
147 }
148}
149
150interface LspChange {
151 range: Range;

Callers 2

applyCodeActionFunction · 0.70
executeCodeActionFunction · 0.70

Calls 1

addLspLogForFunction · 0.90

Tested by

no test coverage detected