feat:实现携带路径发送信息的优化

- 将路径通过doc包裹起来便于后端读取
This commit is contained in:
Roe-xin
2026-03-20 11:45:01 +08:00
parent 4ba096d898
commit 1207d2b91a
8 changed files with 89 additions and 31 deletions

View File

@ -408,7 +408,11 @@ export async function handleWebviewMessage(
if (uris && uris.length > 0) {
const fs = require("fs");
const path = require("path");
const selectedFiles: Array<{ path: string; relativePath: string; size: number }> = [];
const selectedFiles: Array<{
name: string;
absolutePath: string;
size: number;
}> = [];
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB
const MAX_TOTAL_SIZE = 50 * 1024 * 1024; // 50 MB
const MAX_FILES = 1000;
@ -440,8 +444,8 @@ export async function handleWebviewMessage(
}
selectedFiles.push({
path: filePath,
relativePath: vscode.workspace.asRelativePath(filePath),
name: path.basename(filePath),
absolutePath: filePath,
size: stat.size,
});
totalSize += stat.size;