revert: restore AvanteBuild (fixes #792) (#799)

This commit is contained in:
Aaron Pham
2024-11-04 20:44:45 -05:00
committed by GitHub
parent b6f7c193b0
commit 16e10c5f88
2 changed files with 15 additions and 0 deletions

View File

@@ -85,6 +85,20 @@ end, {
})
cmd("Chat", function() require("avante.api").ask({ ask = false }) end, { desc = "avante: chat with the codebase" })
cmd("Toggle", function() require("avante").toggle() end, { desc = "avante: toggle AI panel" })
cmd("Build", function(opts)
local args = {}
for _, arg in ipairs(opts.fargs) do
local key, value = arg:match("(%w+)=(%w+)")
if key and value then args[key] = value == "true" end
end
if args.source == nil then args.source = false end
require("avante.api").build(args)
end, {
desc = "avante: build dependencies",
nargs = "*",
complete = function(_, _, _) return { "source=true", "source=false" } end,
})
cmd(
"Edit",
function(opts) require("avante.api").edit(vim.trim(opts.args)) end,