Skip to content

Commit 0c97a4d

Browse files
authored
feat: add lang (#121)
1 parent 8bfb37a commit 0c97a4d

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

lang/uniast/ast.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
TypeScript Language = "typescript"
3535
Java Language = "java"
3636
Unknown Language = ""
37+
Kotlin Language = "kotlin"
3738
)
3839

3940
func (l Language) String() string {
@@ -72,6 +73,8 @@ func NewLanguage(lang string) (l Language) {
7273
return TypeScript
7374
case "java":
7475
return Java
76+
case "kotlin":
77+
return Kotlin
7578
default:
7679
return Unknown
7780
}

ts-parser/src/parser/ModuleParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class ModuleParser {
9191
}
9292

9393
return {
94-
Language: '', // TypeScript
94+
Language: 'typescript', // TypeScript
9595
Version: moduleVersion,
9696
Name: moduleName,
9797
Dir: isExternal ? '' : relativeDir,

ts-parser/src/types/uniast.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface Repository {
2929
* A compilation unit, e.g., a Go module or an npm package.
3030
*/
3131
export interface Module {
32-
Language: 'go' | 'rust' | 'cxx' | 'python' | '';
32+
Language: 'go' | 'rust' | 'cxx' | 'python' | 'typescript' | '';
3333
Version: string;
3434
Name: string;
3535
/** Path relative to the repository root. Empty string "" denotes an external dependency module. */

ts-parser/src/utils/monorepo.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,4 @@ export class MonorepoUtils {
177177
console.warn(`Error discovering packages in ${currentDir}:`, error);
178178
}
179179
}
180-
181180
}

0 commit comments

Comments
 (0)