Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Fix buildProjectTree for multi-language projects#2

Merged
zedrdave merged 1 commit intomainfrom
fix/multi-language-project-tree
Jan 5, 2026
Merged

Fix buildProjectTree for multi-language projects#2
zedrdave merged 1 commit intomainfrom
fix/multi-language-project-tree

Conversation

@zedrdave
Copy link
Copy Markdown
Member

@zedrdave zedrdave commented Jan 5, 2026

Summary

Fixes two bugs that caused scip_project_tree to fail on mixed TypeScript/Python projects:

Bug 1: buildProjectTree() only supported Python files

  • The method was filtering with if (!relativePath.endsWith('.py')), ignoring all TypeScript/JavaScript files
  • Now uses isSupportedFile() helper that supports: .py, .ts, .tsx, .js, .jsx, .vue, .mts, .cts, .mjs, .cjs
  • Updated pathToModuleName() to strip all supported extensions

Bug 2: Multiple language adapters overwrote each other's indexes

  • When both TypeScript and Python were detected, Python ran second and overwrote the TypeScript index completely
  • Fixed by writing each adapter's output to a temp file, then merging all documents into the final index.scip
  • Added mergeIndexes() method that combines documents from all adapters (avoiding duplicates by path)

Additional improvements

  • Added NeedsReindexError handling to scip_project_tree tool for robustness
  • Added tests for TypeScript and Vue file handling

Testing

Tested on a real Vue/TypeScript project with some Python scripts:

  • Before: Only showed 3 Python modules
  • After: Shows 228 modules (182 JS + 43 TS + 3 Python)

All 59 unit tests pass.

- buildProjectTree() now supports TypeScript/JavaScript/Vue files in addition to Python
- Added isSupportedFile() helper for .ts, .tsx, .js, .jsx, .vue, .mts, .cts, .mjs, .cjs extensions
- Updated pathToModuleName() to handle all supported extensions
- Fixed index merging when multiple language adapters are detected
  - Each adapter now writes to a temp file
  - Indexes are merged into the final index.scip
  - Temp files are cleaned up after merge
- Added NeedsReindexError handling to scip_project_tree tool
- Added tests for TypeScript and Vue file handling in buildProjectTree
@zedrdave zedrdave merged commit da4712a into main Jan 5, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant