From a1b10487a32305d3da418457ae2ece4e9957ca2c Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Thu, 6 Jun 2024 18:35:20 +0800 Subject: [PATCH] Refactor LLMStreamComplete to handle empty lines in removeRepeatBlock --- src/contributes/codecomplete/chunkFilter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contributes/codecomplete/chunkFilter.ts b/src/contributes/codecomplete/chunkFilter.ts index df9dfca..ca1507d 100644 --- a/src/contributes/codecomplete/chunkFilter.ts +++ b/src/contributes/codecomplete/chunkFilter.ts @@ -277,8 +277,8 @@ export class LLMStreamComplete { // whether lines are repeated some block before async removeRepeatBlock(lines: string[]): Promise< string[] > { - if (lines.length === 0) { - return []; + if (lines.length <= 1) { + return lines; } // find first match line in before 50 lines