pair icon indicating copy to clipboard operation
pair copied to clipboard

Diff detection regex is incorrect

Open Shakahs opened this issue 1 year ago • 2 comments

The regex re.search(r'```diff(.*?)```', cr.text, re.DOTALL)" is searching for a marker that is part of Github's proprietary Markdown syntax to enable code highlighting.

The base prompt is asking for output compatible with the patch command, so pair is not detecting any of the code diffs that I generate unless I start them with "generate a github markdown diff...".

Shakahs avatar Mar 23 '23 15:03 Shakahs

we are seeing multiple issues with the diffs. I guess we should add the "generate a github markdown diff" to the base prompt to make it more clear that we expect this particular prefix.

wskish avatar Mar 25 '23 17:03 wskish

The prompt is asking for a patch file and pair is applying it with patch. The regex should be changed to match a patch file.

Shakahs avatar Mar 25 '23 22:03 Shakahs