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

Function executeCodeAction

src/cm/lsp/codeActions.ts:343–365  ·  view source on GitHub ↗
(
	view: EditorView,
	item: CodeActionItem,
)

Source from the content-addressed store, hash-verified

341}
342
343export async function executeCodeAction(
344 view: EditorView,
345 item: CodeActionItem,
346): Promise<boolean> {
347 const plugin = LSPPlugin.get(view);
348 if (!plugin) return false;
349
350 try {
351 plugin.client.sync();
352
353 // Handle standalone Command (not CodeAction)
354 if (isCommand(item.action)) {
355 return executeCommand(plugin, item.action);
356 }
357
358 // Handle CodeAction
359 return applyCodeAction(view, item.action);
360 } catch (error) {
361 addLspLogFor(plugin, "error", "Code action execution failed", error);
362 console.error("[LSP:CodeAction] Failed to execute:", error);
363 return false;
364 }
365}
366
367export function supportsCodeActions(view: EditorView): boolean {
368 const plugin = LSPPlugin.get(view);

Callers 2

showCodeActionsMenuFunction · 0.85
performQuickFixFunction · 0.85

Calls 6

addLspLogForFunction · 0.90
isCommandFunction · 0.85
applyCodeActionFunction · 0.85
executeCommandFunction · 0.70
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected