Skip to content

Commit 90c95bf

Browse files
committed
Expand truncation regex to support JSX and block comment syntax
1 parent fa50cf3 commit 90c95bf

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎packages/vscode/src/commands/apply-chat-response-command/handlers/truncated-handler.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@ import { create_safe_path, sanitize_file_name } from '@/utils/path-sanitizer'
77
import { FileItem } from '../utils/clipboard-parser'
88
import { OriginalFileState } from '../types/original-file-state'
99

10-
const TRUNCATION_REGEX = /^\s*(\/\/|#|<!--|;|"|')\s*\.{3,}.*\s*$/
10+
/*
11+
* Matches lines like:
12+
* // ...
13+
* # ...
14+
* <!-- ...
15+
* ; ...
16+
* " ...
17+
* ' ...
18+
* {/* ...
19+
* /* ...
20+
*/
21+
const TRUNCATION_REGEX = /^\s*(\/\/|#|<!--|;|"|'|\{\/\*|\/\*)\s*\.{3,}.*\s*$/
1122

1223
export const is_truncation_line = (line: string) => TRUNCATION_REGEX.test(line)
1324

0 commit comments

Comments
 (0)