Skip to content

Fix empty code chunks

Hongtao Yang requested to merge fix-empty-code-chunk into main

Currently there is an edge case that we didn't handle properly: if the cursor location is at the beginning or the end of a function, the prompt-engine will return the test case where either code_before is empty or code_after is empty. This is the correct behaviour on the prompt-engine side, however such cases should be filtered out in the pipeline.

This MR handles the edge case and modifies the CodeChunker to skip a code chunk if either code_before or code_after is empty.

Merge request reports