You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/exports/exports.spec.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,10 @@ files:
15
15
- src/exports/csharp.rs
16
16
- src/exports/php.rs
17
17
- src/exports/ruby.rs
18
+
- src/exports/ast/mod.rs
19
+
- src/exports/ast/typescript.rs
20
+
- src/exports/ast/python.rs
21
+
- src/exports/ast/rust_lang.rs
18
22
db_tables: []
19
23
tracks: [60]
20
24
depends_on:
@@ -25,7 +29,7 @@ depends_on:
25
29
26
30
## Purpose
27
31
28
-
Language-aware export extraction from source files. Auto-detects the programming language from file extension and extracts public/exported symbol names using regex-based parsing (no AST required). Supports 11 languages: TypeScript/JS, Rust, Go, Python, Swift, Kotlin, Java, C#, Dart, PHP, and Ruby.
32
+
Language-aware export extraction from source files. Auto-detects the programming language from file extension and extracts public/exported symbol names using regex-based parsing or tree-sitter AST analysis. Supports 11 languages: TypeScript/JS, Rust, Go, Python, Swift, Kotlin, Java, C#, Dart, PHP, and Ruby.
29
33
30
34
## Public API
31
35
@@ -40,6 +44,23 @@ Language-aware export extraction from source files. Auto-detects the programming
40
44
|`has_extension`|`file_path: &Path, extensions: &[String]`|`bool`| Check if file matches specific extensions, or any supported language if extensions is empty |
41
45
|`extract_exports`|`content: &str`|`Vec<String>`| Per-language backend function that parses source text and returns exported symbol names (one per backend file) |
42
46
|`extract_exports_with_resolver`|`content: &str, resolver: Option<&ImportResolver>`|`Vec<String>`| TypeScript-specific: extract exports with optional wildcard re-export resolution via file resolver callback |
47
+
|`get_exported_symbols_full`|`file_path: &Path, level: ExportLevel, parse_mode: ParseMode`|`Vec<String>`| Extract exports with full control over granularity and parse mode (Regex or Ast) |
48
+
49
+
### Exported Modules
50
+
51
+
| Module | Source | Description |
52
+
|--------|--------|-------------|
53
+
|`ast`|`src/exports/mod.rs`| Tree-sitter based AST export extraction backends |
54
+
55
+
### Exported AST Sub-modules
56
+
57
+
Tree-sitter based export extraction backends for TypeScript, Python, and Rust. Used when `ParseMode::Ast` is selected. Falls back to regex extraction for unsupported languages or when AST parsing fails.
58
+
59
+
| Sub-module | File | Description |
60
+
|------------|------|-------------|
61
+
|`typescript`|`ast/typescript.rs`| Tree-sitter based TypeScript/JS export extraction with wildcard resolver support |
62
+
|`python`|`ast/python.rs`| Tree-sitter based Python export extraction using `__all__` and top-level definitions |
63
+
|`rust_lang`|`ast/rust_lang.rs`| Tree-sitter based Rust `pub` item extraction |
0 commit comments