Skip to content

Commit 320bf2c

Browse files
authored
fix: remove the_diff argument (#2246)
1 parent e8aae6c commit 320bf2c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/avante/llm_tools/replace_in_file.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ end
122122
--- IMPORTANT: Using "the_diff" instead of "diff" is to avoid LLM streaming generating function parameters in alphabetical order, which would result in generating "path" after "diff", making it impossible to achieve a streaming diff view.
123123
---@type AvanteLLMToolFunc<{ path: string, diff: string, the_diff?: string, streaming?: boolean, tool_use_id?: string }>
124124
function M.func(opts, on_log, on_complete, session_ctx)
125-
if opts.the_diff ~= nil then opts.diff = opts.the_diff end
125+
if opts.the_diff ~= nil then
126+
opts.diff = opts.the_diff
127+
opts.the_diff = nil
128+
end
126129
if not opts.path or not opts.diff then return false, "path and diff are required " .. vim.inspect(opts) end
127130
if on_log then on_log("path: " .. opts.path) end
128131
local abs_path = Helpers.get_abs_path(opts.path)

0 commit comments

Comments
 (0)