gitlab-ai-review 3.2.2 → 3.2.3
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/lib/prompt-tools.js +19 -34
- package/package.json +1 -1
package/lib/prompt-tools.js
CHANGED
|
@@ -285,43 +285,28 @@ export function buildFileReviewWithImpactPrompt(fileName, meaningfulChanges, imp
|
|
|
285
285
|
|
|
286
286
|
**🔥 关于代码修改的重要理解:**
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
-
|
|
291
|
-
|
|
292
|
-
```
|
|
288
|
+
如果在**同一位置**看到以下情况(删除旧代码,添加新代码):
|
|
289
|
+
- 第一行以 "-" 开头(删除)
|
|
290
|
+
- 第二行以 "+" 开头(新增)
|
|
291
|
+
- 修改的是同一个变量/属性/函数
|
|
293
292
|
|
|
294
293
|
这是**修改(替换)**,不是"重复定义"或"两次定义"!
|
|
295
294
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
❌
|
|
299
|
-
|
|
300
|
-
- const name = 'old';
|
|
301
|
-
+ const name = 'new';
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
-
|
|
308
|
-
+
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
❌ **错误理解**:
|
|
313
|
-
```
|
|
314
|
-
- all: [...addedSymbols, ...deletedSymbols],
|
|
315
|
-
+ all: [...addedSymbols, ...allDeleted],
|
|
316
|
-
```
|
|
317
|
-
错误:❌ "返回对象中存在两个 all 属性"
|
|
318
|
-
|
|
319
|
-
✅ **正确理解**:
|
|
320
|
-
```
|
|
321
|
-
- all: [...addedSymbols, ...deletedSymbols],
|
|
322
|
-
+ all: [...addedSymbols, ...allDeleted],
|
|
323
|
-
```
|
|
324
|
-
正确:✅ "修改了 all 属性的值,从 deletedSymbols 改为 allDeleted"
|
|
295
|
+
**常见错误理解:**
|
|
296
|
+
|
|
297
|
+
❌ 错误示例 1:
|
|
298
|
+
看到:
|
|
299
|
+
- const name = 'old';
|
|
300
|
+
+ const name = 'new';
|
|
301
|
+
错误理解:❌ "代码中定义了两次 name 变量,违反唯一性"
|
|
302
|
+
正确理解:✅ "将 name 的值从 'old' 修改为 'new',这是正常的代码变更"
|
|
303
|
+
|
|
304
|
+
❌ 错误示例 2:
|
|
305
|
+
看到:
|
|
306
|
+
- all: [...addedSymbols, ...deletedSymbols],
|
|
307
|
+
+ all: [...addedSymbols, ...allDeleted],
|
|
308
|
+
错误理解:❌ "返回对象中存在两个 all 属性"
|
|
309
|
+
正确理解:✅ "修改了 all 属性的值,从 deletedSymbols 改为 allDeleted"
|
|
325
310
|
|
|
326
311
|
**核心原则:**
|
|
327
312
|
- **"-"** 的代码已经**不存在**了(被删除)
|