Uh oh!
There was an error while loading. Please reload this page.
feat: Add support for typescript lang - #46
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## main #46 +/- ##
==========================================
+ Coverage 61.26% 62.85% +1.58%
==========================================
Files 47 50 +3 Lines 4123 4501 +378 ==========================================
+ Hits 2526 2829 +303 - Misses 1317 1365 +48 - Partials 280 307 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds first-class TypeScript support to the code analysis framework (language detection/parsing + resolvers) and enables existing plugins (callgraph, depsusage, stripcomments) to operate on TypeScript sources.
Changes:
- Introduce a new
typescriptlanguage implementation backed by the tree-sitter TSX grammar plus TypeScript-specific resolvers for classes/inheritance/abstract methods. - Refactor JavaScript resolvers to reuse shared ECMAScript resolver helpers (imports + functions) and add shared resolver module (
ecmascript_resolvers.go). - Extend multiple plugins (callgraph, depsusage, stripcomments) to include TypeScript in supported languages, plus TS fixtures/tests and updated callgraph expectations.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/stripcomments/stripcomments.go | Add TypeScript to StripCommentsPlugin supported languages. |
| plugin/stripcomments/checks.go | Treat TypeScript comment nodes like JavaScript comment nodes. |
| plugin/depsusage/packagehint.go | Reuse JavaScript package-hint logic for TypeScript modules. |
| plugin/depsusage/ignore.go | Add TypeScript-specific ignore rules and refactor require() ignore logic into a helper. |
| plugin/depsusage/depsusage.go | Add TypeScript to depsusage plugin supported languages. |
| plugin/callgraph/processors.go | Add TS-specific node processor mappings and accept TS/JS argument node variants. |
| plugin/callgraph/plugin_test.go | Update JS callgraph expectations to include resolved call arguments. |
| plugin/callgraph/plugin.go | Add TypeScript to callgraph plugin supported languages. |
| plugin/callgraph/imports.go | Add TypeScript module separator handling (same as JS). |
| plugin/callgraph/callgraph.go | Include TS abstract class nodes as DFS sources. |
| plugin/callgraph/builtins.json | Add TypeScript built-in identifiers list. |
| lang/typescript.go | New TypeScript language implementation using TSX grammar and TS resolvers. |
| lang/typescript_resolvers.go | New TypeScript resolvers: imports/functions + classes/inheritance/abstract methods. |
| lang/typescript_test.go | Unit tests for TypeScript language metadata. |
| lang/typescript_resolvers_test.go | Resolver tests for TS imports and function extraction fixtures. |
| lang/typescript_class_integration_test.go | Integration tests for TS class/inheritance resolution using fixtures. |
| lang/javascript_resolvers.go | Replace duplicated JS resolver logic with shared ECMAScript helpers. |
| lang/ecmascript_resolvers.go | New shared ECMAScript resolver helpers for JS/TS (imports + functions). |
| lang/factory.go | Register LanguageCodeTypescript in the language factory. |
| lang/fixtures/ts_simple_classes.ts | TS fixture for class/interface/enum/decorators coverage. |
| lang/fixtures/ts_class_hierarchy.ts | TS fixture for inheritance + implements + abstract class coverage. |
| lang/fixtures/imports.ts | TS fixture for ES imports + type-only imports + require(). |
| lang/fixtures/functions.ts | TS fixture for typed functions, classes, abstract methods, decorators. |
| examples/plugin/main.go | Add TypeScript to example plugin supported languages. |
| examples/plugin/callgraph/fixtures/testFunctions.ts | Example TS callgraph fixture (functions/scopes/assignments). |
| examples/plugin/callgraph/fixtures/testClasses.ts | Example TS callgraph fixture (interfaces/classes/super calls). |
| examples/plugin/callgraph/fixtures/testClass.ts | Example TS callgraph fixture (constructors/this/union types). |
| examples/plugin/callgraph/fixtures/testArgs.ts | Example TS callgraph fixture for argument parsing. |
| core/language.go | Add LanguageCodeTypescript constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.



No description provided.