Skip to content

Trim completions by the min allowed block

Alexander Chueshev requested to merge ac/clean-model-output-blocks into main

This MR adds language-agnostic logic to trim completions by the minimum allowed block. To identify a minimum allowed block, we make the following steps:

  • shift the cursor to the first non-whitespace character
  • identify the minimum block around the cursor, where the min size (end_line - start_line + 1) is at least 2.

Shifting the cursor is required to address the use cases when the user implements a block and waits for a new one to complete, e.g., different else clauses.

Closes #226 (closed)

Merge request reports