From 71c63260a24ccf2721fe16e028f87b5074e48830 Mon Sep 17 00:00:00 2001 From: "yinxuran.lucky" Date: Fri, 14 Nov 2025 15:29:41 +0800 Subject: [PATCH] feat: add lang --- lang/uniast/ast.go | 3 +++ ts-parser/src/parser/ModuleParser.ts | 2 +- ts-parser/src/types/uniast.ts | 2 +- ts-parser/src/utils/monorepo.ts | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/uniast/ast.go b/lang/uniast/ast.go index 50490eee..15ee92f0 100644 --- a/lang/uniast/ast.go +++ b/lang/uniast/ast.go @@ -34,6 +34,7 @@ const ( TypeScript Language = "typescript" Java Language = "java" Unknown Language = "" + Kotlin Language = "kotlin" ) func (l Language) String() string { @@ -72,6 +73,8 @@ func NewLanguage(lang string) (l Language) { return TypeScript case "java": return Java + case "kotlin": + return Kotlin default: return Unknown } diff --git a/ts-parser/src/parser/ModuleParser.ts b/ts-parser/src/parser/ModuleParser.ts index d35acdff..547b52bb 100644 --- a/ts-parser/src/parser/ModuleParser.ts +++ b/ts-parser/src/parser/ModuleParser.ts @@ -91,7 +91,7 @@ export class ModuleParser { } return { - Language: '', // TypeScript + Language: 'typescript', // TypeScript Version: moduleVersion, Name: moduleName, Dir: isExternal ? '' : relativeDir, diff --git a/ts-parser/src/types/uniast.ts b/ts-parser/src/types/uniast.ts index 2d28fb90..972e0cd2 100644 --- a/ts-parser/src/types/uniast.ts +++ b/ts-parser/src/types/uniast.ts @@ -29,7 +29,7 @@ export interface Repository { * A compilation unit, e.g., a Go module or an npm package. */ export interface Module { - Language: 'go' | 'rust' | 'cxx' | 'python' | ''; + Language: 'go' | 'rust' | 'cxx' | 'python' | 'typescript' | ''; Version: string; Name: string; /** Path relative to the repository root. Empty string "" denotes an external dependency module. */ diff --git a/ts-parser/src/utils/monorepo.ts b/ts-parser/src/utils/monorepo.ts index 93617cd0..ae381649 100644 --- a/ts-parser/src/utils/monorepo.ts +++ b/ts-parser/src/utils/monorepo.ts @@ -177,5 +177,4 @@ export class MonorepoUtils { console.warn(`Error discovering packages in ${currentDir}:`, error); } } - } \ No newline at end of file