ai-commits-intellij-plugin icon indicating copy to clipboard operation
ai-commits-intellij-plugin copied to clipboard

Customize number of lines of context in diff

Open tadamcz opened this issue 1 year ago • 1 comments

Thank you for making this plugin and open sourcing it!

Have you considered supporting the --unified flag?

-U<n> --unified=<n> Generate diffs with lines of context instead of the usual three. Implies --patch.

To begin with, making this an option in the plugin settings would be great.

(To be even more sophisticated, the plugin could set --unified dynamically based on the diff, for example to the largest value that will still allow the diff+prompt to fit in the context)

tadamcz avatar Sep 27 '23 11:09 tadamcz

I am using IntelliJ's com.intellij.openapi.diff.impl.patch.UnifiedDiffWriter for creating prompt. This way I only use changes that are picked in the commit dialog. I can't find any other implementation of diff writer in IntelliJ API and am not ready to write my own, because it's a pretty complex.

Blarc avatar Jan 27 '24 17:01 Blarc