yetone / avante.nvim

Use your Neovim like using Cursor AI IDE!
Apache License 2.0
6.16k stars 221 forks source link

feature: whole-file code review command #616

Open qdbp opened 3 weeks ago

qdbp commented 3 weeks ago

Feature request

I currently have a script with a pre-baked prompt that asks a model to do a whole file review looking for bugs, suggesting improvements, looking for performance issues, etc.

It would be nice if avante similarly had an expedited "whole file review" mode that would be a single command:

that would go straight to diff mode starting from the top of the file. The idea is to fully emulate one cycle of human code review as closely as possible for a single file.

Motivation

The existing editing features are optimized for making targeted, goal oriented changes, initiated by the user; not whole file critique initiated by the model.

Other

I would be willing to take a stab at this feature myself if it's decided that it's useful.

aarnphm commented 2 weeks ago

You can pretty much write custom command for it with some hack around.

Maybe we can also expose the providers API. The reason why we need to open the toolbar is due to how we manage internal state.

do_sth = function()
  require("avante.api").ask({question="..."})
end

I don't think it should be built into avante. There are already too much stuff we need to cover base, so sth like this we can leave it to the users.

maybe you can provide a recipe on how people can do sth like this