ai-commits-intellij-plugin
ai-commits-intellij-plugin copied to clipboard
Customize number of lines of context in diff
Thank you for making this plugin and open sourcing it!
Have you considered supporting the --unified
flag?
-U<n>
--unified=<n>
Generate diffs withlines 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)
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.