@@ -163,8 +163,34 @@ export function registerCvbContextMenu(context: vscode.ExtensionContext) {
163163
164164// 处理聊天内容的独立函数
165165function processChatContent ( text : string ) : string {
166+
167+ let processedText = text ;
168+ const fileStyle = `
169+ display: inline-block;
170+ color: #e1ebe5de; /* 浅绿色文字 */
171+ background-color: #119b4aad; /* 半透明蓝色背景 */
172+ font-style: italic;
173+ margin: 10px 0;
174+ padding: 4px 8px;
175+ border: 2px solid #1e90ff; /* 蓝色边框 */
176+ border-radius: 6px;
177+ box-shadow:
178+ 3px 3px 6px rgba(0, 0, 0, 0.4), /* 外阴影 */
179+ inset 2px 2px 3px rgba(255, 255, 255, 0.3), /* 内亮阴影 */
180+ inset -2px -2px 3px rgba(0, 0, 0, 0.2); /* 内暗阴影 */
181+ ` ;
182+
183+ // 处理 <file_upload> 标签,匹配开始和结束标签
184+ processedText = processedText . replace (
185+ / < F I L E _ U P L O A D \s + d a t a - p a t h = " ( [ ^ " ] + ) " \s * > ( .* ?) < \/ F I L E _ U P L O A D > / gs,
186+ ( match , filePath , content ) => {
187+ // 模拟 file_upload::before,显示 "File: path",忽略原始内容
188+ return `<div style="${ fileStyle } " data-path="${ filePath } ">File: ${ filePath } </div>` ;
189+ }
190+ ) ;
191+
166192 // 为用户和 AI 消息添加类标记
167- let processedText = text . replace ( / ^ @ u s e r : \n / gm, '# 🙋♂️ User:\n> ' ) ;
193+ processedText = processedText . replace ( / ^ @ u s e r : \n / gm, '# 🙋♂️ User:\n> ' ) ;
168194 processedText = processedText . replace ( / ^ @ A I : \n / gm, '# 🧠 AI:\n> ' ) ;
169195
170196 // 处理其他标记
0 commit comments