Skip to content

feat: Add support for typescript lang - #46

Merged
abhisek merged 2 commits into
mainfrom
feat/add-typescript-lang-support
Feb 24, 2026
Merged

feat: Add support for typescript lang#46
abhisek merged 2 commits into
mainfrom
feat/add-typescript-lang-support

Conversation

@abhisek

Copy link
Copy Markdown
Member

No description provided.

@abhisek
abhisek requested a review from a teamFebruary 24, 2026 14:25
@safedep

safedepBot commented Feb 24, 2026

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages BadgeGreen Vulnerable Packages BadgeGreen Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@codecov-commenter

codecov-commenter commented Feb 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.94752% with 165 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.85%. Comparing base (aa08f82) to head (7d2d607).

Files with missing linesPatch %Lines
lang/ecmascript_resolvers.go70.00%68 Missing and 28 partials ⚠️
lang/typescript_resolvers.go79.19%37 Missing and 25 partials ⚠️
plugin/depsusage/ignore.go72.22%5 Missing ⚠️
plugin/callgraph/processors.go92.85%1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 typescript language 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
FileDescription
plugin/stripcomments/stripcomments.goAdd TypeScript to StripCommentsPlugin supported languages.
plugin/stripcomments/checks.goTreat TypeScript comment nodes like JavaScript comment nodes.
plugin/depsusage/packagehint.goReuse JavaScript package-hint logic for TypeScript modules.
plugin/depsusage/ignore.goAdd TypeScript-specific ignore rules and refactor require() ignore logic into a helper.
plugin/depsusage/depsusage.goAdd TypeScript to depsusage plugin supported languages.
plugin/callgraph/processors.goAdd TS-specific node processor mappings and accept TS/JS argument node variants.
plugin/callgraph/plugin_test.goUpdate JS callgraph expectations to include resolved call arguments.
plugin/callgraph/plugin.goAdd TypeScript to callgraph plugin supported languages.
plugin/callgraph/imports.goAdd TypeScript module separator handling (same as JS).
plugin/callgraph/callgraph.goInclude TS abstract class nodes as DFS sources.
plugin/callgraph/builtins.jsonAdd TypeScript built-in identifiers list.
lang/typescript.goNew TypeScript language implementation using TSX grammar and TS resolvers.
lang/typescript_resolvers.goNew TypeScript resolvers: imports/functions + classes/inheritance/abstract methods.
lang/typescript_test.goUnit tests for TypeScript language metadata.
lang/typescript_resolvers_test.goResolver tests for TS imports and function extraction fixtures.
lang/typescript_class_integration_test.goIntegration tests for TS class/inheritance resolution using fixtures.
lang/javascript_resolvers.goReplace duplicated JS resolver logic with shared ECMAScript helpers.
lang/ecmascript_resolvers.goNew shared ECMAScript resolver helpers for JS/TS (imports + functions).
lang/factory.goRegister LanguageCodeTypescript in the language factory.
lang/fixtures/ts_simple_classes.tsTS fixture for class/interface/enum/decorators coverage.
lang/fixtures/ts_class_hierarchy.tsTS fixture for inheritance + implements + abstract class coverage.
lang/fixtures/imports.tsTS fixture for ES imports + type-only imports + require().
lang/fixtures/functions.tsTS fixture for typed functions, classes, abstract methods, decorators.
examples/plugin/main.goAdd TypeScript to example plugin supported languages.
examples/plugin/callgraph/fixtures/testFunctions.tsExample TS callgraph fixture (functions/scopes/assignments).
examples/plugin/callgraph/fixtures/testClasses.tsExample TS callgraph fixture (interfaces/classes/super calls).
examples/plugin/callgraph/fixtures/testClass.tsExample TS callgraph fixture (constructors/this/union types).
examples/plugin/callgraph/fixtures/testArgs.tsExample TS callgraph fixture for argument parsing.
core/language.goAdd LanguageCodeTypescript constant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadplugin/callgraph/processors.go
Comment threadplugin/callgraph/plugin.go
@abhisek
abhisek merged commit 3200512 into mainFeb 24, 2026
6 checks passed
@abhisek
abhisek deleted the feat/add-typescript-lang-support branch February 24, 2026 16:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@abhisek@codecov-commenter@KunalSin9h