@colbymchenry/codegraph 0.6.8 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +179 -476
- package/dist/bin/codegraph.d.ts +0 -5
- package/dist/bin/codegraph.d.ts.map +1 -1
- package/dist/bin/codegraph.js +217 -237
- package/dist/bin/codegraph.js.map +1 -1
- package/dist/bin/uninstall.d.ts +0 -1
- package/dist/bin/uninstall.d.ts.map +1 -1
- package/dist/bin/uninstall.js +3 -29
- package/dist/bin/uninstall.js.map +1 -1
- package/dist/context/index.d.ts +3 -5
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +497 -46
- package/dist/context/index.js.map +1 -1
- package/dist/db/migrations.d.ts +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +10 -1
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/queries.d.ts +53 -0
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +244 -14
- package/dist/db/queries.js.map +1 -1
- package/dist/db/schema.sql +1 -16
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/dist/extraction/dfm-extractor.js +151 -0
- package/dist/extraction/dfm-extractor.js.map +1 -0
- package/dist/extraction/grammars.d.ts +9 -1
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/grammars.js +34 -2
- package/dist/extraction/grammars.js.map +1 -1
- package/dist/extraction/index.d.ts +7 -1
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +373 -22
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +126 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +3 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +72 -0
- package/dist/extraction/languages/csharp.js.map +1 -0
- package/dist/extraction/languages/dart.d.ts +3 -0
- package/dist/extraction/languages/dart.d.ts.map +1 -0
- package/dist/extraction/languages/dart.js +192 -0
- package/dist/extraction/languages/dart.js.map +1 -0
- package/dist/extraction/languages/go.d.ts +3 -0
- package/dist/extraction/languages/go.d.ts.map +1 -0
- package/dist/extraction/languages/go.js +58 -0
- package/dist/extraction/languages/go.js.map +1 -0
- package/dist/extraction/languages/index.d.ts +10 -0
- package/dist/extraction/languages/index.d.ts.map +1 -0
- package/dist/extraction/languages/index.js +43 -0
- package/dist/extraction/languages/index.js.map +1 -0
- package/dist/extraction/languages/java.d.ts +3 -0
- package/dist/extraction/languages/java.d.ts.map +1 -0
- package/dist/extraction/languages/java.js +64 -0
- package/dist/extraction/languages/java.js.map +1 -0
- package/dist/extraction/languages/javascript.d.ts +3 -0
- package/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/dist/extraction/languages/javascript.js +90 -0
- package/dist/extraction/languages/javascript.js.map +1 -0
- package/dist/extraction/languages/kotlin.d.ts +3 -0
- package/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/dist/extraction/languages/kotlin.js +253 -0
- package/dist/extraction/languages/kotlin.js.map +1 -0
- package/dist/extraction/languages/pascal.d.ts +3 -0
- package/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/dist/extraction/languages/pascal.js +66 -0
- package/dist/extraction/languages/pascal.js.map +1 -0
- package/dist/extraction/languages/php.d.ts +3 -0
- package/dist/extraction/languages/php.d.ts.map +1 -0
- package/dist/extraction/languages/php.js +107 -0
- package/dist/extraction/languages/php.js.map +1 -0
- package/dist/extraction/languages/python.d.ts +3 -0
- package/dist/extraction/languages/python.d.ts.map +1 -0
- package/dist/extraction/languages/python.js +56 -0
- package/dist/extraction/languages/python.js.map +1 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +114 -0
- package/dist/extraction/languages/ruby.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +109 -0
- package/dist/extraction/languages/rust.js.map +1 -0
- package/dist/extraction/languages/swift.d.ts +3 -0
- package/dist/extraction/languages/swift.d.ts.map +1 -0
- package/dist/extraction/languages/swift.js +91 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +3 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +129 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +52 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +313 -0
- package/dist/extraction/liquid-extractor.js.map +1 -0
- package/dist/extraction/parse-worker.d.ts +8 -0
- package/dist/extraction/parse-worker.d.ts.map +1 -0
- package/dist/extraction/parse-worker.js +57 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/svelte-extractor.d.ts +47 -0
- package/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/dist/extraction/svelte-extractor.js +230 -0
- package/dist/extraction/svelte-extractor.js.map +1 -0
- package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-helpers.js +103 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +179 -0
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-types.js +10 -0
- package/dist/extraction/tree-sitter-types.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts +67 -125
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +1052 -1855
- package/dist/extraction/tree-sitter.js.map +1 -1
- package/dist/graph/traversal.d.ts.map +1 -1
- package/dist/graph/traversal.js +20 -2
- package/dist/graph/traversal.js.map +1 -1
- package/dist/index.d.ts +29 -53
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -114
- package/dist/index.js.map +1 -1
- package/dist/installer/claude-md-template.d.ts +1 -1
- package/dist/installer/claude-md-template.d.ts.map +1 -1
- package/dist/installer/claude-md-template.js +15 -15
- package/dist/installer/config-writer.d.ts +1 -10
- package/dist/installer/config-writer.d.ts.map +1 -1
- package/dist/installer/config-writer.js +0 -79
- package/dist/installer/config-writer.js.map +1 -1
- package/dist/installer/index.d.ts +3 -4
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +118 -116
- package/dist/installer/index.js.map +1 -1
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +25 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools.d.ts +33 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +405 -21
- package/dist/mcp/tools.js.map +1 -1
- package/dist/resolution/frameworks/csharp.js +29 -84
- package/dist/resolution/frameworks/csharp.js.map +1 -1
- package/dist/resolution/frameworks/express.js +44 -48
- package/dist/resolution/frameworks/express.js.map +1 -1
- package/dist/resolution/frameworks/go.js +34 -70
- package/dist/resolution/frameworks/go.js.map +1 -1
- package/dist/resolution/frameworks/java.js +29 -87
- package/dist/resolution/frameworks/java.js.map +1 -1
- package/dist/resolution/frameworks/laravel.js +6 -6
- package/dist/resolution/frameworks/laravel.js.map +1 -1
- package/dist/resolution/frameworks/python.js +33 -98
- package/dist/resolution/frameworks/python.js.map +1 -1
- package/dist/resolution/frameworks/react.js +53 -76
- package/dist/resolution/frameworks/react.js.map +1 -1
- package/dist/resolution/frameworks/ruby.js +12 -24
- package/dist/resolution/frameworks/ruby.js.map +1 -1
- package/dist/resolution/frameworks/rust.js +26 -66
- package/dist/resolution/frameworks/rust.js.map +1 -1
- package/dist/resolution/frameworks/svelte.js +11 -31
- package/dist/resolution/frameworks/svelte.js.map +1 -1
- package/dist/resolution/frameworks/swift.js +42 -160
- package/dist/resolution/frameworks/swift.js.map +1 -1
- package/dist/resolution/index.d.ts +19 -6
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +300 -141
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/name-matcher.d.ts +5 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -1
- package/dist/resolution/name-matcher.js +148 -8
- package/dist/resolution/name-matcher.js.map +1 -1
- package/dist/resolution/types.d.ts +1 -1
- package/dist/resolution/types.d.ts.map +1 -1
- package/dist/search/query-utils.d.ts +26 -1
- package/dist/search/query-utils.d.ts.map +1 -1
- package/dist/search/query-utils.js +209 -9
- package/dist/search/query-utils.js.map +1 -1
- package/dist/sync/index.d.ts +2 -4
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +4 -3
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/watcher.d.ts +81 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +184 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/dist/ui/shimmer-progress.js +90 -0
- package/dist/ui/shimmer-progress.js.map +1 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/dist/ui/shimmer-worker.js +112 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +3 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/vectors/embedder.js +1 -1
- package/dist/vectors/embedder.js.map +1 -1
- package/package.json +7 -12
- package/scripts/postinstall.js +0 -68
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SvelteExtractor = void 0;
|
|
4
|
+
const tree_sitter_helpers_1 = require("./tree-sitter-helpers");
|
|
5
|
+
const tree_sitter_1 = require("./tree-sitter");
|
|
6
|
+
const grammars_1 = require("./grammars");
|
|
7
|
+
/** Svelte 5 rune names — compiler builtins, not real functions */
|
|
8
|
+
const SVELTE_RUNES = new Set([
|
|
9
|
+
'$props', '$state', '$derived', '$effect', '$bindable',
|
|
10
|
+
'$inspect', '$host', '$snippet',
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* SvelteExtractor - Extracts code relationships from Svelte component files
|
|
14
|
+
*
|
|
15
|
+
* Svelte files are multi-language (script + template + style). Rather than
|
|
16
|
+
* parsing the full Svelte grammar, we extract the <script> block content
|
|
17
|
+
* and delegate it to the TypeScript/JavaScript TreeSitterExtractor.
|
|
18
|
+
*
|
|
19
|
+
* Also extracts function calls from template expressions (`{fn(...)}`) so
|
|
20
|
+
* cross-file call edges are captured even when calls live in markup.
|
|
21
|
+
*
|
|
22
|
+
* Every .svelte file produces a component node (Svelte components are always importable).
|
|
23
|
+
*/
|
|
24
|
+
class SvelteExtractor {
|
|
25
|
+
filePath;
|
|
26
|
+
source;
|
|
27
|
+
nodes = [];
|
|
28
|
+
edges = [];
|
|
29
|
+
unresolvedReferences = [];
|
|
30
|
+
errors = [];
|
|
31
|
+
constructor(filePath, source) {
|
|
32
|
+
this.filePath = filePath;
|
|
33
|
+
this.source = source;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Extract from Svelte source
|
|
37
|
+
*/
|
|
38
|
+
extract() {
|
|
39
|
+
const startTime = Date.now();
|
|
40
|
+
try {
|
|
41
|
+
// Create component node for the .svelte file itself
|
|
42
|
+
const componentNode = this.createComponentNode();
|
|
43
|
+
// Extract and process script blocks
|
|
44
|
+
const scriptBlocks = this.extractScriptBlocks();
|
|
45
|
+
for (const block of scriptBlocks) {
|
|
46
|
+
this.processScriptBlock(block, componentNode.id);
|
|
47
|
+
}
|
|
48
|
+
// Extract function calls from template expressions ({fn(...)})
|
|
49
|
+
this.extractTemplateCalls(componentNode.id, scriptBlocks);
|
|
50
|
+
// Filter out Svelte rune calls ($state, $props, $derived, etc.)
|
|
51
|
+
this.unresolvedReferences = this.unresolvedReferences.filter(ref => !SVELTE_RUNES.has(ref.referenceName));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
this.errors.push({
|
|
55
|
+
message: `Svelte extraction error: ${error instanceof Error ? error.message : String(error)}`,
|
|
56
|
+
severity: 'error',
|
|
57
|
+
code: 'parse_error',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
nodes: this.nodes,
|
|
62
|
+
edges: this.edges,
|
|
63
|
+
unresolvedReferences: this.unresolvedReferences,
|
|
64
|
+
errors: this.errors,
|
|
65
|
+
durationMs: Date.now() - startTime,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a component node for the .svelte file
|
|
70
|
+
*/
|
|
71
|
+
createComponentNode() {
|
|
72
|
+
const lines = this.source.split('\n');
|
|
73
|
+
const fileName = this.filePath.split(/[/\\]/).pop() || this.filePath;
|
|
74
|
+
const componentName = fileName.replace(/\.svelte$/, '');
|
|
75
|
+
const id = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'component', componentName, 1);
|
|
76
|
+
const node = {
|
|
77
|
+
id,
|
|
78
|
+
kind: 'component',
|
|
79
|
+
name: componentName,
|
|
80
|
+
qualifiedName: `${this.filePath}::${componentName}`,
|
|
81
|
+
filePath: this.filePath,
|
|
82
|
+
language: 'svelte',
|
|
83
|
+
startLine: 1,
|
|
84
|
+
endLine: lines.length,
|
|
85
|
+
startColumn: 0,
|
|
86
|
+
endColumn: lines[lines.length - 1]?.length || 0,
|
|
87
|
+
isExported: true, // Svelte components are always importable
|
|
88
|
+
updatedAt: Date.now(),
|
|
89
|
+
};
|
|
90
|
+
this.nodes.push(node);
|
|
91
|
+
return node;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Extract <script> blocks from the Svelte source
|
|
95
|
+
*/
|
|
96
|
+
extractScriptBlocks() {
|
|
97
|
+
const blocks = [];
|
|
98
|
+
const scriptRegex = /<script(\s[^>]*)?>(?<content>[\s\S]*?)<\/script>/g;
|
|
99
|
+
let match;
|
|
100
|
+
while ((match = scriptRegex.exec(this.source)) !== null) {
|
|
101
|
+
const attrs = match[1] || '';
|
|
102
|
+
const content = match.groups?.content || match[2] || '';
|
|
103
|
+
// Detect TypeScript from lang attribute
|
|
104
|
+
const isTypeScript = /lang\s*=\s*["'](ts|typescript)["']/.test(attrs);
|
|
105
|
+
// Detect module script
|
|
106
|
+
const isModule = /context\s*=\s*["']module["']/.test(attrs);
|
|
107
|
+
// Calculate start line of the script content (line after <script>)
|
|
108
|
+
const beforeScript = this.source.substring(0, match.index);
|
|
109
|
+
const scriptTagLine = (beforeScript.match(/\n/g) || []).length;
|
|
110
|
+
// The content starts on the line after the opening <script> tag
|
|
111
|
+
const openingTag = match[0].substring(0, match[0].indexOf('>') + 1);
|
|
112
|
+
const openingTagLines = (openingTag.match(/\n/g) || []).length;
|
|
113
|
+
const contentStartLine = scriptTagLine + openingTagLines + 1; // 0-indexed line
|
|
114
|
+
blocks.push({
|
|
115
|
+
content,
|
|
116
|
+
startLine: contentStartLine,
|
|
117
|
+
isModule,
|
|
118
|
+
isTypeScript,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return blocks;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Process a script block by delegating to TreeSitterExtractor
|
|
125
|
+
*/
|
|
126
|
+
processScriptBlock(block, componentNodeId) {
|
|
127
|
+
const scriptLanguage = block.isTypeScript ? 'typescript' : 'javascript';
|
|
128
|
+
// Check if the script language parser is available
|
|
129
|
+
if (!(0, grammars_1.isLanguageSupported)(scriptLanguage)) {
|
|
130
|
+
this.errors.push({
|
|
131
|
+
message: `Parser for ${scriptLanguage} not available, cannot parse Svelte script block`,
|
|
132
|
+
severity: 'warning',
|
|
133
|
+
});
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
// Delegate to TreeSitterExtractor
|
|
137
|
+
const extractor = new tree_sitter_1.TreeSitterExtractor(this.filePath, block.content, scriptLanguage);
|
|
138
|
+
const result = extractor.extract();
|
|
139
|
+
// Offset line numbers from script block back to .svelte file positions
|
|
140
|
+
for (const node of result.nodes) {
|
|
141
|
+
node.startLine += block.startLine;
|
|
142
|
+
node.endLine += block.startLine;
|
|
143
|
+
node.language = 'svelte'; // Mark as svelte, not TS/JS
|
|
144
|
+
this.nodes.push(node);
|
|
145
|
+
// Add containment edge from component to this node
|
|
146
|
+
this.edges.push({
|
|
147
|
+
source: componentNodeId,
|
|
148
|
+
target: node.id,
|
|
149
|
+
kind: 'contains',
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
// Offset edges (they reference line numbers)
|
|
153
|
+
for (const edge of result.edges) {
|
|
154
|
+
if (edge.line) {
|
|
155
|
+
edge.line += block.startLine;
|
|
156
|
+
}
|
|
157
|
+
this.edges.push(edge);
|
|
158
|
+
}
|
|
159
|
+
// Offset unresolved references
|
|
160
|
+
for (const ref of result.unresolvedReferences) {
|
|
161
|
+
ref.line += block.startLine;
|
|
162
|
+
ref.filePath = this.filePath;
|
|
163
|
+
ref.language = 'svelte';
|
|
164
|
+
this.unresolvedReferences.push(ref);
|
|
165
|
+
}
|
|
166
|
+
// Carry over errors
|
|
167
|
+
for (const error of result.errors) {
|
|
168
|
+
if (error.line) {
|
|
169
|
+
error.line += block.startLine;
|
|
170
|
+
}
|
|
171
|
+
this.errors.push(error);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Extract function calls from Svelte template expressions.
|
|
176
|
+
*
|
|
177
|
+
* In Svelte, many function calls happen in markup (e.g., `class={cn(...)}`),
|
|
178
|
+
* not inside `<script>` blocks. We scan the template portion for `{expression}`
|
|
179
|
+
* blocks and extract call patterns from them.
|
|
180
|
+
*/
|
|
181
|
+
extractTemplateCalls(componentNodeId, _scriptBlocks) {
|
|
182
|
+
// Build a set of line ranges covered by <script> and <style> blocks so we skip them
|
|
183
|
+
const coveredRanges = [];
|
|
184
|
+
// Find all <script>...</script> and <style>...</style> ranges
|
|
185
|
+
const tagRegex = /<(script|style)(\s[^>]*)?>[\s\S]*?<\/\1>/g;
|
|
186
|
+
let tagMatch;
|
|
187
|
+
while ((tagMatch = tagRegex.exec(this.source)) !== null) {
|
|
188
|
+
const startLine = (this.source.substring(0, tagMatch.index).match(/\n/g) || []).length;
|
|
189
|
+
const endLine = startLine + (tagMatch[0].match(/\n/g) || []).length;
|
|
190
|
+
coveredRanges.push([startLine, endLine]);
|
|
191
|
+
}
|
|
192
|
+
// Find template expressions: {...} outside of script/style blocks
|
|
193
|
+
// Matches curly-brace expressions, excluding Svelte block syntax ({#if}, {:else}, {/if}, {@html}, {@render})
|
|
194
|
+
const lines = this.source.split('\n');
|
|
195
|
+
const exprRegex = /\{([^}#/:@][^}]*)\}/g;
|
|
196
|
+
for (let lineIdx = 0; lineIdx < lines.length; lineIdx++) {
|
|
197
|
+
// Skip lines inside script/style blocks
|
|
198
|
+
if (coveredRanges.some(([start, end]) => lineIdx >= start && lineIdx <= end))
|
|
199
|
+
continue;
|
|
200
|
+
const line = lines[lineIdx];
|
|
201
|
+
let exprMatch;
|
|
202
|
+
while ((exprMatch = exprRegex.exec(line)) !== null) {
|
|
203
|
+
const expr = exprMatch[1];
|
|
204
|
+
// Extract function calls: identifiers followed by (
|
|
205
|
+
// Matches: cn(...), buttonVariants(...), obj.method(...)
|
|
206
|
+
const callRegex = /\b([a-zA-Z_$][\w$.]*)\s*\(/g;
|
|
207
|
+
let callMatch;
|
|
208
|
+
while ((callMatch = callRegex.exec(expr)) !== null) {
|
|
209
|
+
const calleeName = callMatch[1];
|
|
210
|
+
// Skip Svelte runes, control flow keywords, and common non-function patterns
|
|
211
|
+
if (SVELTE_RUNES.has(calleeName))
|
|
212
|
+
continue;
|
|
213
|
+
if (calleeName === 'if' || calleeName === 'else' || calleeName === 'each' || calleeName === 'await')
|
|
214
|
+
continue;
|
|
215
|
+
this.unresolvedReferences.push({
|
|
216
|
+
fromNodeId: componentNodeId,
|
|
217
|
+
referenceName: calleeName,
|
|
218
|
+
referenceKind: 'calls',
|
|
219
|
+
line: lineIdx + 1, // 1-indexed
|
|
220
|
+
column: exprMatch.index + callMatch.index,
|
|
221
|
+
filePath: this.filePath,
|
|
222
|
+
language: 'svelte',
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.SvelteExtractor = SvelteExtractor;
|
|
230
|
+
//# sourceMappingURL=svelte-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svelte-extractor.js","sourceRoot":"","sources":["../../src/extraction/svelte-extractor.ts"],"names":[],"mappings":";;;AACA,+DAAuD;AACvD,+CAAoD;AACpD,yCAAiD;AAEjD,kEAAkE;AAClE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW;IACtD,UAAU,EAAE,OAAO,EAAE,UAAU;CAChC,CAAC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAa,eAAe;IAClB,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,KAAK,GAAW,EAAE,CAAC;IACnB,KAAK,GAAW,EAAE,CAAC;IACnB,oBAAoB,GAA0B,EAAE,CAAC;IACjD,MAAM,GAAsB,EAAE,CAAC;IAEvC,YAAY,QAAgB,EAAE,MAAc;QAC1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,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AAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,QAAQ,EAAE,QAAQ;qBACnB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA5PD,0CA4PC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree-sitter Shared Helpers
|
|
3
|
+
*
|
|
4
|
+
* Utility functions used by the core TreeSitterExtractor and per-language extractors.
|
|
5
|
+
* Extracted to a leaf module to avoid circular imports between tree-sitter.ts and languages/.
|
|
6
|
+
*/
|
|
7
|
+
import { Node as SyntaxNode } from 'web-tree-sitter';
|
|
8
|
+
import { NodeKind } from '../types';
|
|
9
|
+
/**
|
|
10
|
+
* Generate a unique node ID
|
|
11
|
+
*
|
|
12
|
+
* Uses a 32-character (128-bit) hash to avoid collisions when indexing
|
|
13
|
+
* large codebases with many files containing similar symbols.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateNodeId(filePath: string, kind: NodeKind, name: string, line: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Extract text from a syntax node
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNodeText(node: SyntaxNode, source: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Find a child node by field name
|
|
22
|
+
*/
|
|
23
|
+
export declare function getChildByField(node: SyntaxNode, fieldName: string): SyntaxNode | null;
|
|
24
|
+
/**
|
|
25
|
+
* Get the docstring/comment preceding a node
|
|
26
|
+
*/
|
|
27
|
+
export declare function getPrecedingDocstring(node: SyntaxNode, source: string): string | undefined;
|
|
28
|
+
//# sourceMappingURL=tree-sitter-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-sitter-helpers.d.ts","sourceRoot":"","sources":["../../src/extraction/tree-sitter-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAEtF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA+B1F"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tree-sitter Shared Helpers
|
|
4
|
+
*
|
|
5
|
+
* Utility functions used by the core TreeSitterExtractor and per-language extractors.
|
|
6
|
+
* Extracted to a leaf module to avoid circular imports between tree-sitter.ts and languages/.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.generateNodeId = generateNodeId;
|
|
43
|
+
exports.getNodeText = getNodeText;
|
|
44
|
+
exports.getChildByField = getChildByField;
|
|
45
|
+
exports.getPrecedingDocstring = getPrecedingDocstring;
|
|
46
|
+
const crypto = __importStar(require("crypto"));
|
|
47
|
+
/**
|
|
48
|
+
* Generate a unique node ID
|
|
49
|
+
*
|
|
50
|
+
* Uses a 32-character (128-bit) hash to avoid collisions when indexing
|
|
51
|
+
* large codebases with many files containing similar symbols.
|
|
52
|
+
*/
|
|
53
|
+
function generateNodeId(filePath, kind, name, line) {
|
|
54
|
+
const hash = crypto
|
|
55
|
+
.createHash('sha256')
|
|
56
|
+
.update(`${filePath}:${kind}:${name}:${line}`)
|
|
57
|
+
.digest('hex')
|
|
58
|
+
.substring(0, 32);
|
|
59
|
+
return `${kind}:${hash}`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Extract text from a syntax node
|
|
63
|
+
*/
|
|
64
|
+
function getNodeText(node, source) {
|
|
65
|
+
return source.substring(node.startIndex, node.endIndex);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Find a child node by field name
|
|
69
|
+
*/
|
|
70
|
+
function getChildByField(node, fieldName) {
|
|
71
|
+
return node.childForFieldName(fieldName);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get the docstring/comment preceding a node
|
|
75
|
+
*/
|
|
76
|
+
function getPrecedingDocstring(node, source) {
|
|
77
|
+
let sibling = node.previousNamedSibling;
|
|
78
|
+
const comments = [];
|
|
79
|
+
while (sibling) {
|
|
80
|
+
if (sibling.type === 'comment' ||
|
|
81
|
+
sibling.type === 'line_comment' ||
|
|
82
|
+
sibling.type === 'block_comment' ||
|
|
83
|
+
sibling.type === 'documentation_comment') {
|
|
84
|
+
comments.unshift(getNodeText(sibling, source));
|
|
85
|
+
sibling = sibling.previousNamedSibling;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (comments.length === 0)
|
|
92
|
+
return undefined;
|
|
93
|
+
// Clean up comment markers
|
|
94
|
+
return comments
|
|
95
|
+
.map((c) => c
|
|
96
|
+
.replace(/^\/\*\*?|\*\/$/g, '')
|
|
97
|
+
.replace(/^\/\/\s?/gm, '')
|
|
98
|
+
.replace(/^\s*\*\s?/gm, '')
|
|
99
|
+
.trim())
|
|
100
|
+
.join('\n')
|
|
101
|
+
.trim();
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=tree-sitter-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-sitter-helpers.js","sourceRoot":"","sources":["../../src/extraction/tree-sitter-helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,wCAYC;AAKD,kCAEC;AAKD,0CAEC;AAKD,sDA+BC;AAvED,+CAAiC;AAGjC;;;;;GAKG;AACH,SA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;IAC3B,OAAO,QAAQ;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT,CAAC;SACE,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;SAC9B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,IAAI,EAAE,CACV;SACA,IAAI,CAAC,IAAI,CAAC;SACV,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree-sitter Extraction Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the LanguageExtractor interface and related types used by
|
|
5
|
+
* the core TreeSitterExtractor and per-language extraction configs.
|
|
6
|
+
* Extracted to a leaf module to avoid circular imports.
|
|
7
|
+
*/
|
|
8
|
+
import { Node as SyntaxNode } from 'web-tree-sitter';
|
|
9
|
+
import { Node, NodeKind, UnresolvedReference } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* Information returned by a language's extractImport hook.
|
|
12
|
+
*/
|
|
13
|
+
export interface ImportInfo {
|
|
14
|
+
/** The module/package name being imported */
|
|
15
|
+
moduleName: string;
|
|
16
|
+
/** Full import statement text for display */
|
|
17
|
+
signature: string;
|
|
18
|
+
/** If true, the hook already created unresolved references itself */
|
|
19
|
+
handledRefs?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Information about a single variable within a declaration.
|
|
23
|
+
* Returned by a language's extractVariables hook.
|
|
24
|
+
*/
|
|
25
|
+
export interface VariableInfo {
|
|
26
|
+
/** Variable name */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Node kind: 'variable' or 'constant' */
|
|
29
|
+
kind: NodeKind;
|
|
30
|
+
/** Optional signature string */
|
|
31
|
+
signature?: string;
|
|
32
|
+
/** If set, this declarator is actually a function and should be extracted as such */
|
|
33
|
+
delegateToFunction?: SyntaxNode;
|
|
34
|
+
/** The AST node to use for positioning (may differ from the declaration node) */
|
|
35
|
+
positionNode?: SyntaxNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Context object passed to language hooks that need to call back into the core extractor.
|
|
39
|
+
* Provides a controlled API surface — hooks can create nodes, visit children, and add
|
|
40
|
+
* references without accessing the full TreeSitterExtractor internals.
|
|
41
|
+
*/
|
|
42
|
+
export interface ExtractorContext {
|
|
43
|
+
/** Create a node and add it to the extraction result */
|
|
44
|
+
createNode(kind: NodeKind, name: string, node: SyntaxNode, extra?: Partial<Node>): Node | null;
|
|
45
|
+
/** Visit a child node (dispatches through the standard visitNode logic) */
|
|
46
|
+
visitNode(node: SyntaxNode): void;
|
|
47
|
+
/** Visit a function body to extract calls */
|
|
48
|
+
visitFunctionBody(body: SyntaxNode, functionId: string): void;
|
|
49
|
+
/** Add an unresolved reference */
|
|
50
|
+
addUnresolvedReference(ref: UnresolvedReference): void;
|
|
51
|
+
/** Push a node ID onto the scope stack (for containment/qualified name building) */
|
|
52
|
+
pushScope(nodeId: string): void;
|
|
53
|
+
/** Pop the last node ID from the scope stack */
|
|
54
|
+
popScope(): void;
|
|
55
|
+
/** Current file path */
|
|
56
|
+
readonly filePath: string;
|
|
57
|
+
/** Current source text */
|
|
58
|
+
readonly source: string;
|
|
59
|
+
/** Stack of parent node IDs (current scope) */
|
|
60
|
+
readonly nodeStack: readonly string[];
|
|
61
|
+
/** All nodes extracted so far */
|
|
62
|
+
readonly nodes: readonly Node[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Language-specific extraction configuration.
|
|
66
|
+
*
|
|
67
|
+
* Each supported language provides an implementation of this interface
|
|
68
|
+
* that configures which AST node types to look for and how to extract
|
|
69
|
+
* language-specific details like signatures, visibility, and imports.
|
|
70
|
+
*/
|
|
71
|
+
export interface LanguageExtractor {
|
|
72
|
+
/** Node types that represent functions */
|
|
73
|
+
functionTypes: string[];
|
|
74
|
+
/** Node types that represent classes */
|
|
75
|
+
classTypes: string[];
|
|
76
|
+
/** Node types that represent methods */
|
|
77
|
+
methodTypes: string[];
|
|
78
|
+
/** Node types that represent interfaces/protocols/traits */
|
|
79
|
+
interfaceTypes: string[];
|
|
80
|
+
/** Node types that represent structs */
|
|
81
|
+
structTypes: string[];
|
|
82
|
+
/** Node types that represent enums */
|
|
83
|
+
enumTypes: string[];
|
|
84
|
+
/** Node types that represent enum members/cases (e.g. Swift: 'enum_entry', Rust: 'enum_variant') */
|
|
85
|
+
enumMemberTypes?: string[];
|
|
86
|
+
/** Node types that represent type aliases (e.g. `type X = ...`) */
|
|
87
|
+
typeAliasTypes: string[];
|
|
88
|
+
/** Node types that represent imports */
|
|
89
|
+
importTypes: string[];
|
|
90
|
+
/** Node types that represent function calls */
|
|
91
|
+
callTypes: string[];
|
|
92
|
+
/** Node types that represent variable declarations (const, let, var, etc.) */
|
|
93
|
+
variableTypes: string[];
|
|
94
|
+
/** Node types that represent class fields (extracted as 'field' kind inside class bodies) */
|
|
95
|
+
fieldTypes?: string[];
|
|
96
|
+
/** Node types that represent class properties (extracted as 'property' kind inside class bodies) */
|
|
97
|
+
propertyTypes?: string[];
|
|
98
|
+
/** Field name for identifier/name */
|
|
99
|
+
nameField: string;
|
|
100
|
+
/** Field name for body */
|
|
101
|
+
bodyField: string;
|
|
102
|
+
/** Field name for parameters */
|
|
103
|
+
paramsField: string;
|
|
104
|
+
/** Field name for return type */
|
|
105
|
+
returnField?: string;
|
|
106
|
+
/** Extract signature from node */
|
|
107
|
+
getSignature?: (node: SyntaxNode, source: string) => string | undefined;
|
|
108
|
+
/** Extract visibility from node */
|
|
109
|
+
getVisibility?: (node: SyntaxNode) => 'public' | 'private' | 'protected' | 'internal' | undefined;
|
|
110
|
+
/** Check if node is exported */
|
|
111
|
+
isExported?: (node: SyntaxNode, source: string) => boolean;
|
|
112
|
+
/** Check if node is async */
|
|
113
|
+
isAsync?: (node: SyntaxNode) => boolean;
|
|
114
|
+
/** Check if node is static */
|
|
115
|
+
isStatic?: (node: SyntaxNode) => boolean;
|
|
116
|
+
/** Check if variable declaration is a constant (const vs let/var) */
|
|
117
|
+
isConst?: (node: SyntaxNode) => boolean;
|
|
118
|
+
/** Additional node types to treat as class declarations (e.g. Dart: 'mixin_declaration') */
|
|
119
|
+
extraClassNodeTypes?: string[];
|
|
120
|
+
/** Whether methods can be top-level without enclosing class (Go: true) */
|
|
121
|
+
methodsAreTopLevel?: boolean;
|
|
122
|
+
/** NodeKind to use for interface-like declarations (Rust: 'trait'). Default: 'interface' */
|
|
123
|
+
interfaceKind?: NodeKind;
|
|
124
|
+
/**
|
|
125
|
+
* Custom node visitor. Return true if the node was fully handled (skip default dispatch).
|
|
126
|
+
* Used by languages with fundamentally different AST structures (e.g. Pascal).
|
|
127
|
+
*/
|
|
128
|
+
visitNode?: (node: SyntaxNode, ctx: ExtractorContext) => boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Classify a class_declaration node when the grammar reuses one node type
|
|
131
|
+
* for multiple concepts (e.g. Swift uses class_declaration for classes, structs, and enums).
|
|
132
|
+
*/
|
|
133
|
+
classifyClassNode?: (node: SyntaxNode) => 'class' | 'struct' | 'enum' | 'interface' | 'trait';
|
|
134
|
+
/**
|
|
135
|
+
* Resolve the body node for a function/method/class when it's not a child field.
|
|
136
|
+
* (e.g. Dart puts function_body as a sibling, not a child.)
|
|
137
|
+
*/
|
|
138
|
+
resolveBody?: (node: SyntaxNode, bodyField: string) => SyntaxNode | null;
|
|
139
|
+
/**
|
|
140
|
+
* Extract import information from an import node.
|
|
141
|
+
* Return null if the node isn't a recognized import form.
|
|
142
|
+
*/
|
|
143
|
+
extractImport?: (node: SyntaxNode, source: string) => ImportInfo | null;
|
|
144
|
+
/**
|
|
145
|
+
* Extract variable declarations from a variable declaration node.
|
|
146
|
+
* Returns info about each declared variable, allowing the core to create nodes.
|
|
147
|
+
*/
|
|
148
|
+
extractVariables?: (node: SyntaxNode, source: string) => VariableInfo[];
|
|
149
|
+
/**
|
|
150
|
+
* Extract receiver/owner type name from a method declaration.
|
|
151
|
+
* Used by Go to get the struct receiver (e.g., "scrapeLoop" from "func (sl *scrapeLoop) run()").
|
|
152
|
+
* When present, the receiver type is included in the qualified name for better searchability.
|
|
153
|
+
*/
|
|
154
|
+
getReceiverType?: (node: SyntaxNode, source: string) => string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Resolve the actual node kind for a type alias declaration.
|
|
157
|
+
* Used by Go where `type_spec` is the named declaration wrapper for structs/interfaces:
|
|
158
|
+
* `type Foo struct { ... }` → type_spec (name: "Foo") → struct_type
|
|
159
|
+
* Returns 'struct', 'interface', etc. to override the default 'type_alias' kind,
|
|
160
|
+
* or undefined to keep it as a type alias.
|
|
161
|
+
*/
|
|
162
|
+
resolveTypeAliasKind?: (node: SyntaxNode, source: string) => NodeKind | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Check if a function/method name is a misparse artifact that should be skipped.
|
|
165
|
+
* Used by C/C++ where macros (e.g. NLOHMANN_JSON_NAMESPACE_BEGIN) cause tree-sitter
|
|
166
|
+
* to misparse namespace blocks as function_definitions. When this returns true,
|
|
167
|
+
* the function node is NOT created, but the body is still visited for calls and
|
|
168
|
+
* structural nodes (classes, structs, enums).
|
|
169
|
+
*/
|
|
170
|
+
isMisparsedFunction?: (name: string, node: SyntaxNode) => boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Detect bare method calls that don't use call expression syntax.
|
|
173
|
+
* Used by Ruby where `reset` (no parens, no receiver) is a method call but
|
|
174
|
+
* tree-sitter parses it as a plain `identifier` node instead of `call`/`method_call`.
|
|
175
|
+
* Returns the callee name if this node is a bare call, or undefined if not.
|
|
176
|
+
*/
|
|
177
|
+
extractBareCall?: (node: SyntaxNode, source: string) => string | undefined;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=tree-sitter-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-sitter-types.d.ts","sourceRoot":"","sources":["../../src/extraction/tree-sitter-types.ts"],"names":[],"mappings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AM,EAAE,MAAM,KAAK,YAAY,EAAE,CAAC;IAExE;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE3E;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAElF;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IAElE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC5E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tree-sitter Extraction Types
|
|
4
|
+
*
|
|
5
|
+
* Defines the LanguageExtractor interface and related types used by
|
|
6
|
+
* the core TreeSitterExtractor and per-language extraction configs.
|
|
7
|
+
* Extracted to a leaf module to avoid circular imports.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
//# sourceMappingURL=tree-sitter-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-sitter-types.js","sourceRoot":"","sources":["../../src/extraction/tree-sitter-types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
|