Commit 3185cd3
committed
feat(phase-3): Task 3.3.4 - add import metadata extraction
Sub-task 3.3.4: Implement Import Metadata Extraction
- Added extractFileImports() method to extract all import statements from a file
- Imported extractImportInfo() from metadata-extractor (Phase 2)
- Imported ImportInfo type from types/metadata
- Returns array of ImportInfo to be included in all chunks
Implementation:
- Queries tree for import_statement nodes
- Uses extractImportInfo() from Phase 2 to parse each import
- Returns ImportInfo[] with source, symbols, isDefault, isDynamic, alias
- Gracefully handles extraction errors (import extraction is optional)
Benefits:
- All chunks will have import context as metadata
- Addresses Issue RooCodeInc#3 from CHUNKING_ANALYSIS.md (lost import context)
- Enables understanding of dependencies and types
- Complements Phase 2's metadata extraction
This will be integrated in Sub-task 3.3.5 to populate the imports field in CodeBlock:
- Extract imports once per file
- Include in all chunks from that file
- Provides type and dependency context
File modified: src/services/code-index/processors/parser.ts (+29 lines)
Sub-task 3.3.4 complete! Next: Sub-task 3.3.5 - Implement Smart Chunking Logic1 parent 3db6c45 commit 3185cd3
1 file changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
654 | 655 | | |
655 | 656 | | |
656 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
657 | 685 | | |
658 | 686 | | |
659 | 687 | | |
| |||
0 commit comments