File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1414
1515# 忽略操作系统生成的文件
1616.DS_Store
17- Thumbs.db
17+ Thumbs.db
18+ tmp /*
19+ .CodeReDesignWorkSpace /*
Original file line number Diff line number Diff line change @@ -173,15 +173,15 @@ export function parseCvb(cvbContent: string): {
173173 files : Record < string , string > ;
174174} {
175175 // 匹配## BEGIN_CVB在行首的位置
176- const cvbStartRegex = / ^ # # B E G I N _ C V B / m;
176+ const cvbStartRegex = / ^ # # B E G I N _ C V B ( \s | $ ) / m;
177177 const cvbStartMatch = cvbStartRegex . exec ( cvbContent ) ;
178178 if ( ! cvbStartMatch ) {
179179 throw new Error ( 'Invalid CVB format: missing BEGIN_CVB marker.' ) ;
180180 }
181181 const cvbStartIndex = cvbStartMatch . index ;
182182
183183 // 匹配## END_CVB在行首的位置
184- const cvbEndRegex = / ^ # # E N D _ C V B / m;
184+ const cvbEndRegex = / ^ # # E N D _ C V B ( \s | $ ) / m;
185185 const cvbEndMatch = cvbEndRegex . exec ( cvbContent ) ;
186186 if ( ! cvbEndMatch ) {
187187 throw new Error ( 'Invalid CVB format: missing END_CVB marker.' ) ;
@@ -192,7 +192,7 @@ export function parseCvb(cvbContent: string): {
192192 const cvbContentStr = cvbContent . slice ( cvbStartIndex , cvbEndIndex + cvbEndMatch [ 0 ] . length ) ;
193193
194194 // 提取元数据部分
195- const metaRegex = / ^ # # M E T A \n ( [ \s \S ] * ?) ^ # # E N D _ M E T A / m;
195+ const metaRegex = / ^ # # M E T A \n ( [ \s \S ] * ?) ^ # # E N D _ M E T A ( \s | $ ) / m;
196196 const metaMatch = metaRegex . exec ( cvbContentStr ) ;
197197 if ( ! metaMatch ) {
198198 throw new Error ( 'Invalid CVB format: missing META section.' ) ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ async function callDeepSeekApi(
4343) : Promise < string | null > {
4444 const apiKey = getDeepSeekApiKey ( ) ;
4545 if ( ! apiKey ) {
46+ vscode . window . showWarningMessage ( '请先设置DeepSeek API Key' ) ;
4647 return null ;
4748 }
4849
@@ -65,6 +66,8 @@ async function callDeepSeekApi(
6566 let maxAttempts = 5 ;
6667 let attempts = 0 ;
6768
69+ vscode . window . showInformationMessage ( '开始上传DeepSeek API' ) ;
70+
6871 while ( attempts < maxAttempts ) {
6972 attempts ++ ;
7073 const response = await openai . chat . completions . create ( {
@@ -75,6 +78,8 @@ async function callDeepSeekApi(
7578 temperature : 0
7679 } ) ;
7780
81+ vscode . window . showInformationMessage ( 'DeepSeek API 正在处理...' ) ;
82+
7883 let chunkResponse = '' ;
7984 let finishReason : string | null = null ;
8085
@@ -106,6 +111,8 @@ async function callDeepSeekApi(
106111
107112 if ( ! shouldContinue ) { break } ;
108113
114+ vscode . window . showWarningMessage ( '超过最大Token数,正在重试...' ) ;
115+
109116 // 准备下一次请求
110117 messages_body . push (
111118 { role : 'assistant' , content : fullResponse } ,
You can’t perform that action at this time.
0 commit comments