Skip to content

Commit 0a229a6

Browse files
committed
feat(ai-completion): Remove debug console logs from adapters and utilities
1 parent 674fc63 commit 0a229a6

5 files changed

Lines changed: 2 additions & 31 deletions

File tree

packages/plugins/script/src/ai-completion/adapters/deepseekAdapter.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ import { API_ENDPOINTS, HTTP_CONFIG } from '../constants.js'
1313
* @returns {{ messages: Array, cursorContext: null }} Messages 和上下文
1414
*/
1515
export function buildDeepSeekMessages(context, instruction, fileContent) {
16-
// eslint-disable-next-line no-console
17-
console.log('🎯 使用 DeepSeek Chat 格式')
18-
1916
const systemPrompt = `${context}\n\n${SYSTEM_BASE_PROMPT}`
2017
const userPrompt = createUserPrompt(instruction, fileContent)
2118

packages/plugins/script/src/ai-completion/adapters/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,13 @@ export function createCompletionHandler() {
8181
// 构建 DeepSeek FIM 端点:将 /v1 替换为 /beta
8282
const completionBaseUrl = baseUrl.replace(DEEPSEEK_CONFIG.PATH_REPLACE, DEEPSEEK_CONFIG.COMPLETION_PATH)
8383

84-
// eslint-disable-next-line no-console
85-
console.log('🔧 DeepSeek FIM 端点:', completionBaseUrl)
86-
8784
completionText = await callDeepSeekAPI(messages, config, apiKey, completionBaseUrl, httpClient)
8885
}
8986

9087
// 6. 处理补全结果
9188
if (completionText) {
9289
completionText = completionText.trim()
9390

94-
// eslint-disable-next-line no-console
95-
console.log('✅ 收到补全:', completionText.substring(0, DEFAULTS.LOG_PREVIEW_LENGTH))
96-
9791
completionText = cleanCompletion(completionText, modelType, cursorContext)
9892

9993
return {

packages/plugins/script/src/ai-completion/adapters/qwenAdapter.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ import { QWEN_CONFIG, HTTP_CONFIG, ERROR_MESSAGES } from '../constants.js'
1313
export function buildQwenMessages(fileContent, fimBuilder) {
1414
const { fimPrompt, cursorContext } = fimBuilder.buildOptimizedFIMPrompt(fileContent)
1515

16-
// eslint-disable-next-line no-console
17-
console.log('🎯 使用 Qwen FIM 格式')
18-
// eslint-disable-next-line no-console
19-
console.log('📊 FIM 上下文:', cursorContext.type)
20-
// eslint-disable-next-line no-console
21-
console.log('📏 FIM Prompt 长度:', fimPrompt.length)
22-
2316
return {
2417
messages: [
2518
{
@@ -43,9 +36,6 @@ export async function callQwenAPI(messages, config, apiKey, baseUrl) {
4336
// 构建完整的 Completions API URL
4437
const completionsUrl = `${baseUrl}${QWEN_CONFIG.COMPLETION_PATH}`
4538

46-
// eslint-disable-next-line no-console
47-
console.log('📦 模型:', config.model)
48-
4939
const requestBody = {
5040
model: config.model,
5141
prompt: messages[0].content, // FIM prompt

packages/plugins/script/src/ai-completion/builders/promptBuilder.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export function createSmartPrompt(completionMetadata) {
184184
const validation = validateLowcodeContext(lowcodeContext)
185185

186186
if (!validation.valid) {
187-
// console.warn('⚠️ Lowcode context validation warnings:', validation.warnings);
187+
// eslint-disable-next-line no-console
188+
console.warn('⚠️ Lowcode context validation warnings:', validation.warnings)
188189
}
189190

190191
instruction = createLowcodeInstruction(language, lowcodeContext)

packages/plugins/script/src/ai-completion/utils/debounceManager.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class DebounceManager {
2828
*/
2929
clearDebounceTimer() {
3030
if (this.debounceTimer) {
31-
// eslint-disable-next-line no-console
32-
console.log('⏱️ [DebounceManager] 清理防抖定时器')
3331
clearTimeout(this.debounceTimer)
3432
this.debounceTimer = null
3533
}
@@ -58,23 +56,16 @@ class DebounceManager {
5856

5957
// 如果启用了防抖且不应该立即执行
6058
if (this.isDebounceEnabled && !this.shouldExecuteImmediately()) {
61-
// eslint-disable-next-line no-console
62-
console.log(`⏳ [DebounceManager] 防抖延迟 ${this.debounceDelay}ms`)
6359
// 清理之前的防抖定时器
6460
this.clearDebounceTimer()
6561

6662
// 创建新的防抖 Promise
6763
await new Promise((resolve) => {
6864
this.debounceTimer = setTimeout(() => {
6965
this.debounceTimer = null
70-
// eslint-disable-next-line no-console
71-
console.log('✅ [DebounceManager] 防抖延迟结束,准备执行请求')
7266
resolve()
7367
}, this.debounceDelay)
7468
})
75-
} else {
76-
// eslint-disable-next-line no-console
77-
console.log('⚡ [DebounceManager] 立即执行(无防抖)')
7869
}
7970

8071
// 执行实际的请求处理器
@@ -90,8 +81,6 @@ class DebounceManager {
9081
* 重置状态(用于清理)
9182
*/
9283
reset() {
93-
// eslint-disable-next-line no-console
94-
console.log('🔄 [DebounceManager] 重置状态')
9584
this.clearDebounceTimer()
9685
}
9786
}

0 commit comments

Comments
 (0)