Package io.codemodder.plugins.llm
Class LLMDiffs
java.lang.Object
io.codemodder.plugins.llm.LLMDiffs
Utilities for working with diff patches returned by an LLM.
-
Method Summary
-
Method Details
-
applyDiff
Applies a diff in unified format totarget.If the LLM was handed code with unusual indentation, it can struggle to create a diff patch with that indentation preserved. This will attempt to fix the indentation of the original lines in the diff patch before passing it to
UnifiedDiffUtilsfor parsing.- Parameters:
target- The target.diff- The diff.- Returns:
- The patched target.
- Throws:
IllegalArgumentException- If the diff cannot be applied totarget.
-