diff --git a/src/features/projects/services/repoScan.ts b/src/features/projects/services/repoScan.ts index 8a4cb55..b3d5949 100644 --- a/src/features/projects/services/repoScan.ts +++ b/src/features/projects/services/repoScan.ts @@ -5,7 +5,7 @@ import { taskControl } from "@/shared/services/taskControl"; type GithubTreeItem = { path: string; type: "blob" | "tree"; size?: number; url: string; sha: string }; const TEXT_EXTENSIONS = [ - ".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", ".cs", ".php", ".rb", ".kt", ".swift", ".sql", ".sh", ".json", ".yml", ".yaml" + ".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", ".cc", ".hh", ".cs", ".php", ".rb", ".kt", ".swift", ".sql", ".sh", ".json", ".yml", ".yaml" // 注意:已移除 .md,因为文档文件会导致LLM返回非JSON格式 ]; const MAX_FILE_SIZE_BYTES = 200 * 1024; diff --git a/src/features/projects/services/repoZipScan.ts b/src/features/projects/services/repoZipScan.ts index a73dcfe..baf8dbd 100644 --- a/src/features/projects/services/repoZipScan.ts +++ b/src/features/projects/services/repoZipScan.ts @@ -4,7 +4,7 @@ import { api } from "@/shared/config/database"; import { taskControl } from "@/shared/services/taskControl"; const TEXT_EXTENSIONS = [ - ".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", + ".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", ".cc", ".hh", ".cs", ".php", ".rb", ".kt", ".swift", ".sql", ".sh", ".json", ".yml", ".yaml" // 注意:已移除 .md,因为文档文件会导致LLM返回非JSON格式 ]; @@ -99,6 +99,9 @@ function getLanguageFromPath(path: string): string { 'rs': 'rust', 'cpp': 'cpp', 'c': 'cpp', + 'cc': 'cpp', + 'h': 'cpp', + 'hh': 'cpp', 'cs': 'csharp', 'php': 'php', 'rb': 'ruby', diff --git a/src/pages/InstantAnalysis.tsx b/src/pages/InstantAnalysis.tsx index ce52d08..9b4618e 100644 --- a/src/pages/InstantAnalysis.tsx +++ b/src/pages/InstantAnalysis.tsx @@ -226,6 +226,9 @@ public class Example { 'rs': 'rust', 'cpp': 'cpp', 'c': 'cpp', + 'cc': 'cpp', + 'h': 'cpp', + 'hh': 'cpp', 'cs': 'csharp', 'php': 'php', 'rb': 'ruby' @@ -523,7 +526,7 @@ public class Example { diff --git a/src/shared/utils/utils.ts b/src/shared/utils/utils.ts index dfd1fd5..8102292 100644 --- a/src/shared/utils/utils.ts +++ b/src/shared/utils/utils.ts @@ -91,6 +91,9 @@ export function getLanguageFromExtension(extension: string): string { 'rs': 'rust', 'cpp': 'cpp', 'c': 'cpp', + 'cc': 'cpp', + 'h': 'cpp', + 'hh': 'cpp', 'cs': 'csharp', 'php': 'php', 'rb': 'ruby',