cciwon-code-review-cli 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/code-review.js +13 -1
- package/package.json +1 -1
package/bin/code-review.js
CHANGED
|
@@ -31,16 +31,24 @@ function parseDiffAndShowInVSCode(reviewText, originalFilePath) {
|
|
|
31
31
|
let reviewContent = [];
|
|
32
32
|
let inDiffBlock = false;
|
|
33
33
|
|
|
34
|
+
// 디버깅: 전체 응답 확인
|
|
35
|
+
console.log(chalk.gray('\n[디버그] 응답 텍스트 일부:'));
|
|
36
|
+
console.log(chalk.gray(reviewText.substring(0, 500) + '...\n'));
|
|
37
|
+
|
|
34
38
|
for (let i = 0; i < lines.length; i++) {
|
|
35
39
|
const line = lines[i];
|
|
36
40
|
|
|
37
41
|
// unified diff 시작 감지 (--- 와 +++ 패턴)
|
|
38
|
-
|
|
42
|
+
// "--- 원본" 또는 "--- a/file" 형식도 지원
|
|
43
|
+
if ((line.startsWith('---') || line.includes('--- ')) &&
|
|
44
|
+
i + 1 < lines.length &&
|
|
45
|
+
(lines[i + 1].startsWith('+++') || lines[i + 1].includes('+++ '))) {
|
|
39
46
|
inDiffBlock = true;
|
|
40
47
|
currentDiff = {
|
|
41
48
|
filename: null,
|
|
42
49
|
diffLines: [line, lines[i + 1]]
|
|
43
50
|
};
|
|
51
|
+
console.log(chalk.yellow(`\n[디버그] diff 블록 발견: ${line}`));
|
|
44
52
|
i++; // +++ 라인 건너뛰기
|
|
45
53
|
continue;
|
|
46
54
|
}
|
|
@@ -53,6 +61,7 @@ function parseDiffAndShowInVSCode(reviewText, originalFilePath) {
|
|
|
53
61
|
// diff 블록 종료
|
|
54
62
|
if (currentDiff) {
|
|
55
63
|
diffs.push(currentDiff);
|
|
64
|
+
console.log(chalk.yellow(`[디버그] diff 블록 종료 (라인 수: ${currentDiff.diffLines.length})`));
|
|
56
65
|
currentDiff = null;
|
|
57
66
|
}
|
|
58
67
|
inDiffBlock = false;
|
|
@@ -69,8 +78,11 @@ function parseDiffAndShowInVSCode(reviewText, originalFilePath) {
|
|
|
69
78
|
// 마지막 diff 저장
|
|
70
79
|
if (currentDiff) {
|
|
71
80
|
diffs.push(currentDiff);
|
|
81
|
+
console.log(chalk.yellow(`[디버그] 마지막 diff 블록 저장 (라인 수: ${currentDiff.diffLines.length})`));
|
|
72
82
|
}
|
|
73
83
|
|
|
84
|
+
console.log(chalk.cyan(`\n[디버그] 총 ${diffs.length}개의 diff 블록 발견\n`));
|
|
85
|
+
|
|
74
86
|
// diff가 있으면 VSCode로 표시
|
|
75
87
|
if (diffs.length > 0) {
|
|
76
88
|
diffs.forEach((diff, index) => {
|