fix: emit formatter events from hashline-edit tool (fixes #2117)

This commit is contained in:
YeonGyu-Kim
2026-03-23 18:22:49 +09:00
parent d5d7c7dd26
commit f95d3b1ef5
4 changed files with 157 additions and 4 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ import { tool, type ToolContext, type ToolDefinition } from "@opencode-ai/plugin
import { executeHashlineEditTool } from "./hashline-edit-executor"
import { HASHLINE_EDIT_DESCRIPTION } from "./tool-description"
import type { RawHashlineEdit } from "./normalize-edits"
import type { PluginContext } from "../../plugin/types"
interface HashlineEditArgs {
filePath: string
@@ -10,7 +11,7 @@ interface HashlineEditArgs {
rename?: string
}
export function createHashlineEditTool(): ToolDefinition {
export function createHashlineEditTool(ctx?: PluginContext): ToolDefinition {
return tool({
description: HASHLINE_EDIT_DESCRIPTION,
args: {
@@ -36,6 +37,6 @@ export function createHashlineEditTool(): ToolDefinition {
)
.describe("Array of edit operations to apply (empty when delete=true)"),
},
execute: async (args: HashlineEditArgs, context: ToolContext) => executeHashlineEditTool(args, context),
execute: async (args: HashlineEditArgs, context: ToolContext) => executeHashlineEditTool(args, context, ctx),
})
}