fix(#97): prevent suggestions on GitHub from starting outside of diff hunk #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Looking at the manual failing cases for GitHub comment suggestions, I saw that we were failing cause the AI was deciding to create the multi-line comment outside of the diff hunk displayed in the diff (see picture). This is not allowed on GitHub.
The AI had no information to make a better decision for this, so I gave it that information in this PR.
The likelyhood of this happening will never be 0 (cause AIs are dumb), but we have a fallback with no suggestions for that scenario. On GitLab, this is not an issue because suggestions are simply markdown, and in the worse case scenario there it renders like a normal code block.
closes #97 closes #24