Blarc / ai-commits-intellij-plugin

AI Commits for IntelliJ based IDEs/Android Studio.
https://plugins.jetbrains.com/plugin/21335-ai-commits
MIT License
189 stars 26 forks source link

Customize number of lines of context in diff #91

Open tadamcz opened 1 year ago

tadamcz commented 1 year ago

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)

Blarc commented 8 months ago

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.