@saluzi/codegraph 0.1.0 → 0.2.0
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/LICENSE +21 -0
- package/README.md +885 -0
- package/package.json +42 -10
- package/scripts/add-lang/bench.sh +60 -0
- package/scripts/add-lang/check-grammar.mjs +75 -0
- package/scripts/add-lang/dump-ast.mjs +103 -0
- package/scripts/add-lang/verify-extraction.mjs +70 -0
- package/scripts/agent-eval/ab-adoption.sh +91 -0
- package/scripts/agent-eval/ab-hook.sh +86 -0
- package/scripts/agent-eval/ab-impl.sh +78 -0
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
- package/scripts/agent-eval/ab-sufficiency.sh +78 -0
- package/scripts/agent-eval/arms-F.sh +21 -0
- package/scripts/agent-eval/arms-matrix.sh +37 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/bench-readme.sh +28 -0
- package/scripts/agent-eval/bench-why-repo.sh +22 -0
- package/scripts/agent-eval/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +120 -0
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
- package/scripts/agent-eval/offload-eval-setup.sh +24 -0
- package/scripts/agent-eval/offload-eval-styles.sh +72 -0
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
- package/scripts/agent-eval/offload-eval.md +76 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
- package/scripts/agent-eval/parse-run.mjs +45 -0
- package/scripts/agent-eval/parse-session.mjs +93 -0
- package/scripts/agent-eval/probe-context.mjs +21 -0
- package/scripts/agent-eval/probe-explore.mjs +40 -0
- package/scripts/agent-eval/probe-node.mjs +20 -0
- package/scripts/agent-eval/probe-sweep.mjs +119 -0
- package/scripts/agent-eval/probe-trace.mjs +20 -0
- package/scripts/agent-eval/redirect-read-hook.sh +38 -0
- package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -0
- package/scripts/agent-eval/repro-daemon-clients.mjs +125 -0
- package/scripts/agent-eval/run-agent.sh +34 -0
- package/scripts/agent-eval/run-all.sh +75 -0
- package/scripts/agent-eval/run-arms.sh +56 -0
- package/scripts/agent-eval/seq-matrix.mjs +137 -0
- package/scripts/build-bundle.sh +123 -0
- package/scripts/extract-release-notes.mjs +130 -0
- package/scripts/local-install.sh +41 -0
- package/scripts/npm-sdk.js +75 -0
- package/scripts/npm-shim.js +275 -0
- package/scripts/pack-npm.sh +119 -0
- package/scripts/prepare-release.mjs +270 -0
- package/dist/bin/codegraph.d.ts +0 -25
- package/dist/bin/node-version-check.d.ts +0 -37
- package/dist/bin/uninstall.d.ts +0 -14
- package/dist/context/formatter.d.ts +0 -33
- package/dist/context/formatter.js +0 -244
- package/dist/context/index.d.ts +0 -117
- package/dist/context/index.js +0 -1050
- package/dist/db/index.d.ts +0 -101
- package/dist/db/index.js +0 -250
- package/dist/db/migrations.d.ts +0 -47
- package/dist/db/migrations.js +0 -131
- package/dist/db/queries.d.ts +0 -291
- package/dist/db/queries.js +0 -1349
- package/dist/db/schema.sql +0 -151
- package/dist/db/sqlite-adapter.d.ts +0 -49
- package/dist/db/sqlite-adapter.js +0 -141
- package/dist/directory.d.ts +0 -62
- package/dist/directory.js +0 -264
- package/dist/errors.d.ts +0 -149
- package/dist/errors.js +0 -219
- package/dist/extraction/dfm-extractor.d.ts +0 -31
- package/dist/extraction/dfm-extractor.js +0 -151
- package/dist/extraction/grammars.d.ts +0 -94
- package/dist/extraction/grammars.js +0 -357
- package/dist/extraction/index.d.ts +0 -148
- package/dist/extraction/index.js +0 -1286
- package/dist/extraction/languages/c-cpp.d.ts +0 -4
- package/dist/extraction/languages/c-cpp.js +0 -126
- package/dist/extraction/languages/csharp.d.ts +0 -3
- package/dist/extraction/languages/csharp.js +0 -72
- package/dist/extraction/languages/dart.d.ts +0 -3
- package/dist/extraction/languages/dart.js +0 -192
- package/dist/extraction/languages/go.d.ts +0 -3
- package/dist/extraction/languages/go.js +0 -58
- package/dist/extraction/languages/index.d.ts +0 -10
- package/dist/extraction/languages/index.js +0 -49
- package/dist/extraction/languages/java.d.ts +0 -3
- package/dist/extraction/languages/java.js +0 -64
- package/dist/extraction/languages/javascript.d.ts +0 -3
- package/dist/extraction/languages/javascript.js +0 -90
- package/dist/extraction/languages/kotlin.d.ts +0 -3
- package/dist/extraction/languages/kotlin.js +0 -253
- package/dist/extraction/languages/lua.d.ts +0 -3
- package/dist/extraction/languages/lua.js +0 -150
- package/dist/extraction/languages/luau.d.ts +0 -3
- package/dist/extraction/languages/luau.js +0 -37
- package/dist/extraction/languages/pascal.d.ts +0 -3
- package/dist/extraction/languages/pascal.js +0 -66
- package/dist/extraction/languages/php.d.ts +0 -3
- package/dist/extraction/languages/php.js +0 -107
- package/dist/extraction/languages/python.d.ts +0 -3
- package/dist/extraction/languages/python.js +0 -56
- package/dist/extraction/languages/ruby.d.ts +0 -3
- package/dist/extraction/languages/ruby.js +0 -114
- package/dist/extraction/languages/rust.d.ts +0 -3
- package/dist/extraction/languages/rust.js +0 -109
- package/dist/extraction/languages/scala.d.ts +0 -3
- package/dist/extraction/languages/scala.js +0 -139
- package/dist/extraction/languages/swift.d.ts +0 -3
- package/dist/extraction/languages/swift.js +0 -91
- package/dist/extraction/languages/typescript.d.ts +0 -3
- package/dist/extraction/languages/typescript.js +0 -129
- package/dist/extraction/liquid-extractor.d.ts +0 -52
- package/dist/extraction/liquid-extractor.js +0 -313
- package/dist/extraction/parse-worker.d.ts +0 -8
- package/dist/extraction/parse-worker.js +0 -94
- package/dist/extraction/svelte-extractor.d.ts +0 -56
- package/dist/extraction/svelte-extractor.js +0 -272
- package/dist/extraction/tree-sitter-helpers.d.ts +0 -39
- package/dist/extraction/tree-sitter-helpers.js +0 -103
- package/dist/extraction/tree-sitter-types.d.ts +0 -191
- package/dist/extraction/tree-sitter-types.js +0 -10
- package/dist/extraction/tree-sitter.d.ts +0 -238
- package/dist/extraction/tree-sitter.js +0 -2430
- package/dist/extraction/vue-extractor.d.ts +0 -36
- package/dist/extraction/vue-extractor.js +0 -163
- package/dist/extraction/wasm/tree-sitter-c.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cpp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-dart.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-php.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-ruby.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-rust.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-swift.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +0 -46
- package/dist/extraction/wasm-runtime-flags.js +0 -105
- package/dist/graph/index.d.ts +0 -8
- package/dist/graph/index.js +0 -13
- package/dist/graph/queries.d.ts +0 -109
- package/dist/graph/queries.js +0 -366
- package/dist/graph/traversal.d.ts +0 -137
- package/dist/graph/traversal.js +0 -528
- package/dist/index.d.ts +0 -509
- package/dist/index.js +0 -800
- package/dist/installer/claude-md-template.d.ts +0 -19
- package/dist/installer/config-writer.d.ts +0 -29
- package/dist/installer/index.d.ts +0 -140
- package/dist/installer/instructions-template.d.ts +0 -30
- package/dist/installer/targets/claude.d.ts +0 -55
- package/dist/installer/targets/codex.d.ts +0 -18
- package/dist/installer/targets/cursor.d.ts +0 -35
- package/dist/installer/targets/hermes.d.ts +0 -18
- package/dist/installer/targets/opencode.d.ts +0 -30
- package/dist/installer/targets/registry.d.ts +0 -38
- package/dist/installer/targets/shared.d.ts +0 -92
- package/dist/installer/targets/toml.d.ts +0 -64
- package/dist/installer/targets/types.d.ts +0 -122
- package/dist/mcp/index.d.ts +0 -98
- package/dist/mcp/server-instructions.d.ts +0 -20
- package/dist/mcp/tools.d.ts +0 -269
- package/dist/mcp/transport.d.ts +0 -117
- package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -20
- package/dist/resolution/frameworks/cargo-workspace.js +0 -225
- package/dist/resolution/frameworks/csharp.d.ts +0 -8
- package/dist/resolution/frameworks/csharp.js +0 -213
- package/dist/resolution/frameworks/drupal.d.ts +0 -51
- package/dist/resolution/frameworks/drupal.js +0 -335
- package/dist/resolution/frameworks/express.d.ts +0 -8
- package/dist/resolution/frameworks/express.js +0 -225
- package/dist/resolution/frameworks/go.d.ts +0 -8
- package/dist/resolution/frameworks/go.js +0 -158
- package/dist/resolution/frameworks/index.d.ts +0 -52
- package/dist/resolution/frameworks/index.js +0 -137
- package/dist/resolution/frameworks/java.d.ts +0 -8
- package/dist/resolution/frameworks/java.js +0 -177
- package/dist/resolution/frameworks/laravel.d.ts +0 -13
- package/dist/resolution/frameworks/laravel.js +0 -248
- package/dist/resolution/frameworks/nestjs.d.ts +0 -26
- package/dist/resolution/frameworks/nestjs.js +0 -374
- package/dist/resolution/frameworks/python.d.ts +0 -10
- package/dist/resolution/frameworks/python.js +0 -278
- package/dist/resolution/frameworks/react.d.ts +0 -8
- package/dist/resolution/frameworks/react.js +0 -272
- package/dist/resolution/frameworks/ruby.d.ts +0 -8
- package/dist/resolution/frameworks/ruby.js +0 -198
- package/dist/resolution/frameworks/rust.d.ts +0 -8
- package/dist/resolution/frameworks/rust.js +0 -207
- package/dist/resolution/frameworks/svelte.d.ts +0 -9
- package/dist/resolution/frameworks/svelte.js +0 -249
- package/dist/resolution/frameworks/swift.d.ts +0 -10
- package/dist/resolution/frameworks/swift.js +0 -376
- package/dist/resolution/frameworks/vue.d.ts +0 -9
- package/dist/resolution/frameworks/vue.js +0 -306
- package/dist/resolution/import-resolver.d.ts +0 -61
- package/dist/resolution/import-resolver.js +0 -663
- package/dist/resolution/index.d.ts +0 -118
- package/dist/resolution/index.js +0 -744
- package/dist/resolution/lru-cache.d.ts +0 -24
- package/dist/resolution/lru-cache.js +0 -62
- package/dist/resolution/name-matcher.d.ts +0 -50
- package/dist/resolution/name-matcher.js +0 -384
- package/dist/resolution/path-aliases.d.ts +0 -72
- package/dist/resolution/path-aliases.js +0 -238
- package/dist/resolution/strip-comments.d.ts +0 -40
- package/dist/resolution/strip-comments.js +0 -441
- package/dist/resolution/types.d.ts +0 -181
- package/dist/resolution/types.js +0 -8
- package/dist/search/query-parser.d.ts +0 -61
- package/dist/search/query-parser.js +0 -177
- package/dist/search/query-utils.d.ts +0 -59
- package/dist/search/query-utils.js +0 -383
- package/dist/sync/git-hooks.d.ts +0 -54
- package/dist/sync/git-hooks.js +0 -223
- package/dist/sync/index.d.ts +0 -25
- package/dist/sync/index.js +0 -28
- package/dist/sync/watch-policy.d.ts +0 -51
- package/dist/sync/watch-policy.js +0 -124
- package/dist/sync/watcher.d.ts +0 -83
- package/dist/sync/watcher.js +0 -192
- package/dist/types.d.ts +0 -433
- package/dist/types.js +0 -75
- package/dist/ui/glyphs.d.ts +0 -42
- package/dist/ui/shimmer-progress.d.ts +0 -11
- package/dist/ui/shimmer-worker.d.ts +0 -2
- package/dist/ui/types.d.ts +0 -20
- package/dist/utils.d.ts +0 -231
- package/dist/utils.js +0 -549
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cppExtractor = exports.cExtractor = void 0;
|
|
4
|
-
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
-
exports.cExtractor = {
|
|
6
|
-
functionTypes: ['function_definition'],
|
|
7
|
-
classTypes: [],
|
|
8
|
-
methodTypes: [],
|
|
9
|
-
interfaceTypes: [],
|
|
10
|
-
structTypes: ['struct_specifier'],
|
|
11
|
-
enumTypes: ['enum_specifier'],
|
|
12
|
-
enumMemberTypes: ['enumerator'],
|
|
13
|
-
typeAliasTypes: ['type_definition'], // typedef
|
|
14
|
-
importTypes: ['preproc_include'],
|
|
15
|
-
callTypes: ['call_expression'],
|
|
16
|
-
variableTypes: ['declaration'],
|
|
17
|
-
nameField: 'declarator',
|
|
18
|
-
bodyField: 'body',
|
|
19
|
-
paramsField: 'parameters',
|
|
20
|
-
resolveTypeAliasKind: (node, _source) => {
|
|
21
|
-
// C typedef: `typedef enum { ... } name;` or `typedef struct { ... } name;`
|
|
22
|
-
// The inner enum_specifier/struct_specifier is anonymous, but we want the typedef name
|
|
23
|
-
// to become the enum/struct node name.
|
|
24
|
-
for (let i = 0; i < node.namedChildCount; i++) {
|
|
25
|
-
const child = node.namedChild(i);
|
|
26
|
-
if (!child)
|
|
27
|
-
continue;
|
|
28
|
-
if (child.type === 'enum_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
|
|
29
|
-
return 'enum';
|
|
30
|
-
if (child.type === 'struct_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
|
|
31
|
-
return 'struct';
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
},
|
|
35
|
-
extractImport: (node, source) => {
|
|
36
|
-
const importText = source.substring(node.startIndex, node.endIndex).trim();
|
|
37
|
-
// C includes: #include <stdio.h>, #include "myheader.h"
|
|
38
|
-
const systemLib = node.namedChildren.find((c) => c.type === 'system_lib_string');
|
|
39
|
-
if (systemLib) {
|
|
40
|
-
return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(systemLib, source).replace(/^<|>$/g, ''), signature: importText };
|
|
41
|
-
}
|
|
42
|
-
const stringLiteral = node.namedChildren.find((c) => c.type === 'string_literal');
|
|
43
|
-
if (stringLiteral) {
|
|
44
|
-
const stringContent = stringLiteral.namedChildren.find((c) => c.type === 'string_content');
|
|
45
|
-
if (stringContent) {
|
|
46
|
-
return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(stringContent, source), signature: importText };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
exports.cppExtractor = {
|
|
53
|
-
functionTypes: ['function_definition'],
|
|
54
|
-
classTypes: ['class_specifier'],
|
|
55
|
-
methodTypes: ['function_definition'],
|
|
56
|
-
interfaceTypes: [],
|
|
57
|
-
structTypes: ['struct_specifier'],
|
|
58
|
-
enumTypes: ['enum_specifier'],
|
|
59
|
-
enumMemberTypes: ['enumerator'],
|
|
60
|
-
typeAliasTypes: ['type_definition', 'alias_declaration'], // typedef and using
|
|
61
|
-
importTypes: ['preproc_include'],
|
|
62
|
-
callTypes: ['call_expression'],
|
|
63
|
-
variableTypes: ['declaration'],
|
|
64
|
-
nameField: 'declarator',
|
|
65
|
-
bodyField: 'body',
|
|
66
|
-
paramsField: 'parameters',
|
|
67
|
-
getVisibility: (node) => {
|
|
68
|
-
// Check for access specifier in parent
|
|
69
|
-
const parent = node.parent;
|
|
70
|
-
if (parent) {
|
|
71
|
-
for (let i = 0; i < parent.childCount; i++) {
|
|
72
|
-
const child = parent.child(i);
|
|
73
|
-
if (child?.type === 'access_specifier') {
|
|
74
|
-
const text = child.text;
|
|
75
|
-
if (text.includes('public'))
|
|
76
|
-
return 'public';
|
|
77
|
-
if (text.includes('private'))
|
|
78
|
-
return 'private';
|
|
79
|
-
if (text.includes('protected'))
|
|
80
|
-
return 'protected';
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return undefined;
|
|
85
|
-
},
|
|
86
|
-
resolveTypeAliasKind: (node, _source) => {
|
|
87
|
-
// C++ typedef: `typedef enum { ... } name;` or `typedef struct { ... } name;`
|
|
88
|
-
for (let i = 0; i < node.namedChildCount; i++) {
|
|
89
|
-
const child = node.namedChild(i);
|
|
90
|
-
if (!child)
|
|
91
|
-
continue;
|
|
92
|
-
if (child.type === 'enum_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
|
|
93
|
-
return 'enum';
|
|
94
|
-
if (child.type === 'struct_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
|
|
95
|
-
return 'struct';
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
98
|
-
},
|
|
99
|
-
isMisparsedFunction: (name) => {
|
|
100
|
-
// C++ macros like NLOHMANN_JSON_NAMESPACE_BEGIN cause tree-sitter to misparse
|
|
101
|
-
// namespace blocks as function_definitions (e.g. name = "namespace detail").
|
|
102
|
-
// Also filter C++ keywords that tree-sitter occasionally misinterprets as
|
|
103
|
-
// function/method names (e.g. switch statements inside macro-confused scopes).
|
|
104
|
-
if (name.startsWith('namespace'))
|
|
105
|
-
return true;
|
|
106
|
-
const cppKeywords = ['switch', 'if', 'for', 'while', 'do', 'case', 'return'];
|
|
107
|
-
return cppKeywords.includes(name);
|
|
108
|
-
},
|
|
109
|
-
extractImport: (node, source) => {
|
|
110
|
-
const importText = source.substring(node.startIndex, node.endIndex).trim();
|
|
111
|
-
// C++ includes: #include <iostream>, #include "myheader.h"
|
|
112
|
-
const systemLib = node.namedChildren.find((c) => c.type === 'system_lib_string');
|
|
113
|
-
if (systemLib) {
|
|
114
|
-
return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(systemLib, source).replace(/^<|>$/g, ''), signature: importText };
|
|
115
|
-
}
|
|
116
|
-
const stringLiteral = node.namedChildren.find((c) => c.type === 'string_literal');
|
|
117
|
-
if (stringLiteral) {
|
|
118
|
-
const stringContent = stringLiteral.namedChildren.find((c) => c.type === 'string_content');
|
|
119
|
-
if (stringContent) {
|
|
120
|
-
return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(stringContent, source), signature: importText };
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return null;
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
//# sourceMappingURL=c-cpp.js.map
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.csharpExtractor = void 0;
|
|
4
|
-
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
-
exports.csharpExtractor = {
|
|
6
|
-
functionTypes: [],
|
|
7
|
-
classTypes: ['class_declaration'],
|
|
8
|
-
methodTypes: ['method_declaration', 'constructor_declaration'],
|
|
9
|
-
interfaceTypes: ['interface_declaration'],
|
|
10
|
-
structTypes: ['struct_declaration'],
|
|
11
|
-
enumTypes: ['enum_declaration'],
|
|
12
|
-
enumMemberTypes: ['enum_member_declaration'],
|
|
13
|
-
typeAliasTypes: [],
|
|
14
|
-
importTypes: ['using_directive'],
|
|
15
|
-
callTypes: ['invocation_expression'],
|
|
16
|
-
variableTypes: ['local_declaration_statement'],
|
|
17
|
-
fieldTypes: ['field_declaration'],
|
|
18
|
-
propertyTypes: ['property_declaration'],
|
|
19
|
-
nameField: 'name',
|
|
20
|
-
bodyField: 'body',
|
|
21
|
-
paramsField: 'parameter_list',
|
|
22
|
-
getVisibility: (node) => {
|
|
23
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
24
|
-
const child = node.child(i);
|
|
25
|
-
if (child?.type === 'modifier') {
|
|
26
|
-
const text = child.text;
|
|
27
|
-
if (text === 'public')
|
|
28
|
-
return 'public';
|
|
29
|
-
if (text === 'private')
|
|
30
|
-
return 'private';
|
|
31
|
-
if (text === 'protected')
|
|
32
|
-
return 'protected';
|
|
33
|
-
if (text === 'internal')
|
|
34
|
-
return 'internal';
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return 'private'; // C# defaults to private
|
|
38
|
-
},
|
|
39
|
-
isStatic: (node) => {
|
|
40
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
41
|
-
const child = node.child(i);
|
|
42
|
-
if (child?.type === 'modifier' && child.text === 'static') {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
},
|
|
48
|
-
isAsync: (node) => {
|
|
49
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
50
|
-
const child = node.child(i);
|
|
51
|
-
if (child?.type === 'modifier' && child.text === 'async') {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
},
|
|
57
|
-
extractImport: (node, source) => {
|
|
58
|
-
const importText = source.substring(node.startIndex, node.endIndex).trim();
|
|
59
|
-
// C# using directives: using System, using System.Collections.Generic, using static X, using Alias = X
|
|
60
|
-
const qualifiedName = node.namedChildren.find((c) => c.type === 'qualified_name');
|
|
61
|
-
if (qualifiedName) {
|
|
62
|
-
return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(qualifiedName, source), signature: importText };
|
|
63
|
-
}
|
|
64
|
-
// Simple namespace like "using System;" - get the first identifier
|
|
65
|
-
const identifier = node.namedChildren.find((c) => c.type === 'identifier');
|
|
66
|
-
if (identifier) {
|
|
67
|
-
return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(identifier, source), signature: importText };
|
|
68
|
-
}
|
|
69
|
-
return null;
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=csharp.js.map
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dartExtractor = void 0;
|
|
4
|
-
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
-
exports.dartExtractor = {
|
|
6
|
-
functionTypes: ['function_signature'],
|
|
7
|
-
classTypes: ['class_definition'],
|
|
8
|
-
methodTypes: ['method_signature'],
|
|
9
|
-
interfaceTypes: [],
|
|
10
|
-
structTypes: [],
|
|
11
|
-
enumTypes: ['enum_declaration'],
|
|
12
|
-
enumMemberTypes: ['enum_constant'],
|
|
13
|
-
typeAliasTypes: ['type_alias'],
|
|
14
|
-
importTypes: ['import_or_export'],
|
|
15
|
-
callTypes: [], // Dart calls use identifier+selector, handled via extractBareCall
|
|
16
|
-
variableTypes: [],
|
|
17
|
-
extraClassNodeTypes: ['mixin_declaration', 'extension_declaration'],
|
|
18
|
-
resolveBody: (node, bodyField) => {
|
|
19
|
-
// Dart: function_body is a next sibling of function_signature/method_signature
|
|
20
|
-
if (node.type === 'function_signature' || node.type === 'method_signature') {
|
|
21
|
-
const next = node.nextNamedSibling;
|
|
22
|
-
if (next?.type === 'function_body')
|
|
23
|
-
return next;
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
// For class/mixin/extension: try standard field, then class_body/extension_body
|
|
27
|
-
const standard = node.childForFieldName(bodyField);
|
|
28
|
-
if (standard)
|
|
29
|
-
return standard;
|
|
30
|
-
return node.namedChildren.find((c) => c.type === 'class_body' || c.type === 'extension_body') || null;
|
|
31
|
-
},
|
|
32
|
-
nameField: 'name',
|
|
33
|
-
bodyField: 'body', // class_definition uses 'body' field
|
|
34
|
-
paramsField: 'formal_parameter_list',
|
|
35
|
-
returnField: 'type',
|
|
36
|
-
getSignature: (node, source) => {
|
|
37
|
-
// For function_signature: extract params + return type
|
|
38
|
-
// For method_signature: delegate to inner function_signature
|
|
39
|
-
let sig = node;
|
|
40
|
-
if (node.type === 'method_signature') {
|
|
41
|
-
const inner = node.namedChildren.find((c) => c.type === 'function_signature' || c.type === 'getter_signature' || c.type === 'setter_signature');
|
|
42
|
-
if (inner)
|
|
43
|
-
sig = inner;
|
|
44
|
-
}
|
|
45
|
-
const params = sig.namedChildren.find((c) => c.type === 'formal_parameter_list');
|
|
46
|
-
const retType = sig.namedChildren.find((c) => c.type === 'type_identifier' || c.type === 'void_type');
|
|
47
|
-
if (!params && !retType)
|
|
48
|
-
return undefined;
|
|
49
|
-
let result = '';
|
|
50
|
-
if (retType)
|
|
51
|
-
result += (0, tree_sitter_helpers_1.getNodeText)(retType, source) + ' ';
|
|
52
|
-
if (params)
|
|
53
|
-
result += (0, tree_sitter_helpers_1.getNodeText)(params, source);
|
|
54
|
-
return result.trim() || undefined;
|
|
55
|
-
},
|
|
56
|
-
getVisibility: (node) => {
|
|
57
|
-
// Dart convention: _ prefix means private, otherwise public
|
|
58
|
-
let nameNode = null;
|
|
59
|
-
if (node.type === 'method_signature') {
|
|
60
|
-
const inner = node.namedChildren.find((c) => c.type === 'function_signature' || c.type === 'getter_signature' || c.type === 'setter_signature');
|
|
61
|
-
if (inner)
|
|
62
|
-
nameNode = inner.namedChildren.find((c) => c.type === 'identifier') || null;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
nameNode = node.childForFieldName('name');
|
|
66
|
-
}
|
|
67
|
-
if (nameNode && nameNode.text.startsWith('_'))
|
|
68
|
-
return 'private';
|
|
69
|
-
return 'public';
|
|
70
|
-
},
|
|
71
|
-
isAsync: (node) => {
|
|
72
|
-
// In Dart, 'async' is on the function_body (next sibling), not the signature
|
|
73
|
-
const nextSibling = node.nextNamedSibling;
|
|
74
|
-
if (nextSibling?.type === 'function_body') {
|
|
75
|
-
for (let i = 0; i < nextSibling.childCount; i++) {
|
|
76
|
-
const child = nextSibling.child(i);
|
|
77
|
-
if (child?.type === 'async')
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
},
|
|
83
|
-
isStatic: (node) => {
|
|
84
|
-
// For method_signature, check for 'static' child
|
|
85
|
-
if (node.type === 'method_signature') {
|
|
86
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
87
|
-
const child = node.child(i);
|
|
88
|
-
if (child?.type === 'static')
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return false;
|
|
93
|
-
},
|
|
94
|
-
extractImport: (node, source) => {
|
|
95
|
-
const importText = source.substring(node.startIndex, node.endIndex).trim();
|
|
96
|
-
let moduleName = '';
|
|
97
|
-
// Dart imports: import 'dart:async'; import 'package:foo/bar.dart' as bar;
|
|
98
|
-
const libraryImport = node.namedChildren.find((c) => c.type === 'library_import');
|
|
99
|
-
if (libraryImport) {
|
|
100
|
-
const importSpec = libraryImport.namedChildren.find((c) => c.type === 'import_specification');
|
|
101
|
-
if (importSpec) {
|
|
102
|
-
const configurableUri = importSpec.namedChildren.find((c) => c.type === 'configurable_uri');
|
|
103
|
-
if (configurableUri) {
|
|
104
|
-
const uri = configurableUri.namedChildren.find((c) => c.type === 'uri');
|
|
105
|
-
if (uri) {
|
|
106
|
-
const stringLiteral = uri.namedChildren.find((c) => c.type === 'string_literal');
|
|
107
|
-
if (stringLiteral) {
|
|
108
|
-
moduleName = (0, tree_sitter_helpers_1.getNodeText)(stringLiteral, source).replace(/['"]/g, '');
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// Also handle exports: export 'src/foo.dart';
|
|
115
|
-
if (!moduleName) {
|
|
116
|
-
const libraryExport = node.namedChildren.find((c) => c.type === 'library_export');
|
|
117
|
-
if (libraryExport) {
|
|
118
|
-
const configurableUri = libraryExport.namedChildren.find((c) => c.type === 'configurable_uri');
|
|
119
|
-
if (configurableUri) {
|
|
120
|
-
const uri = configurableUri.namedChildren.find((c) => c.type === 'uri');
|
|
121
|
-
if (uri) {
|
|
122
|
-
const stringLiteral = uri.namedChildren.find((c) => c.type === 'string_literal');
|
|
123
|
-
if (stringLiteral) {
|
|
124
|
-
moduleName = (0, tree_sitter_helpers_1.getNodeText)(stringLiteral, source).replace(/['"]/g, '');
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (moduleName) {
|
|
131
|
-
return { moduleName, signature: importText };
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
},
|
|
135
|
-
extractBareCall: (node, _source) => {
|
|
136
|
-
// Dart calls are: identifier + selector(argument_part), not a dedicated call node.
|
|
137
|
-
// Match on selector nodes that contain argument_part.
|
|
138
|
-
if (node.type === 'selector') {
|
|
139
|
-
const hasArgPart = node.namedChildren.some((c) => c.type === 'argument_part');
|
|
140
|
-
if (!hasArgPart)
|
|
141
|
-
return undefined;
|
|
142
|
-
const prev = node.previousNamedSibling;
|
|
143
|
-
if (!prev)
|
|
144
|
-
return undefined;
|
|
145
|
-
// Simple function/constructor call: prev is identifier (e.g., runApp(...), MyWidget(...))
|
|
146
|
-
if (prev.type === 'identifier') {
|
|
147
|
-
return prev.text;
|
|
148
|
-
}
|
|
149
|
-
// Method call: prev is selector with accessor (e.g., obj.method(...), Navigator.push(...))
|
|
150
|
-
if (prev.type === 'selector') {
|
|
151
|
-
const accessor = prev.namedChildren.find((c) => c.type === 'unconditional_assignable_selector' || c.type === 'conditional_assignable_selector');
|
|
152
|
-
if (accessor) {
|
|
153
|
-
const methodId = accessor.namedChildren.find((c) => c.type === 'identifier');
|
|
154
|
-
if (methodId) {
|
|
155
|
-
// Include receiver for first call in chain (receiver is a direct identifier)
|
|
156
|
-
const accessorPrev = prev.previousNamedSibling;
|
|
157
|
-
if (accessorPrev?.type === 'identifier') {
|
|
158
|
-
return accessorPrev.text + '.' + methodId.text;
|
|
159
|
-
}
|
|
160
|
-
return methodId.text;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
// super.method() / this.method(): prev is bare unconditional_assignable_selector
|
|
165
|
-
if (prev.type === 'unconditional_assignable_selector' || prev.type === 'conditional_assignable_selector') {
|
|
166
|
-
const methodId = prev.namedChildren.find((c) => c.type === 'identifier');
|
|
167
|
-
if (methodId)
|
|
168
|
-
return methodId.text;
|
|
169
|
-
}
|
|
170
|
-
return undefined;
|
|
171
|
-
}
|
|
172
|
-
// new MyWidget() — explicit constructor call
|
|
173
|
-
if (node.type === 'new_expression') {
|
|
174
|
-
const typeId = node.namedChildren.find((c) => c.type === 'type_identifier');
|
|
175
|
-
if (typeId)
|
|
176
|
-
return typeId.text;
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
// const EdgeInsets.all(8.0) — const constructor call
|
|
180
|
-
if (node.type === 'const_object_expression') {
|
|
181
|
-
const typeId = node.namedChildren.find((c) => c.type === 'type_identifier');
|
|
182
|
-
const nameId = node.namedChildren.find((c) => c.type === 'identifier');
|
|
183
|
-
if (typeId && nameId)
|
|
184
|
-
return typeId.text + '.' + nameId.text;
|
|
185
|
-
if (typeId)
|
|
186
|
-
return typeId.text;
|
|
187
|
-
return undefined;
|
|
188
|
-
}
|
|
189
|
-
return undefined;
|
|
190
|
-
},
|
|
191
|
-
};
|
|
192
|
-
//# sourceMappingURL=dart.js.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.goExtractor = void 0;
|
|
4
|
-
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
-
exports.goExtractor = {
|
|
6
|
-
functionTypes: ['function_declaration'],
|
|
7
|
-
classTypes: [], // Go doesn't have classes
|
|
8
|
-
methodTypes: ['method_declaration'],
|
|
9
|
-
interfaceTypes: [], // Handled via type_spec → resolveTypeAliasKind
|
|
10
|
-
structTypes: [], // Handled via type_spec → resolveTypeAliasKind
|
|
11
|
-
enumTypes: [],
|
|
12
|
-
typeAliasTypes: ['type_spec'], // Go type declarations
|
|
13
|
-
importTypes: ['import_declaration'],
|
|
14
|
-
callTypes: ['call_expression'],
|
|
15
|
-
variableTypes: ['var_declaration', 'short_var_declaration', 'const_declaration'],
|
|
16
|
-
methodsAreTopLevel: true,
|
|
17
|
-
nameField: 'name',
|
|
18
|
-
bodyField: 'body',
|
|
19
|
-
paramsField: 'parameters',
|
|
20
|
-
returnField: 'result',
|
|
21
|
-
getSignature: (node, source) => {
|
|
22
|
-
const params = (0, tree_sitter_helpers_1.getChildByField)(node, 'parameters');
|
|
23
|
-
const result = (0, tree_sitter_helpers_1.getChildByField)(node, 'result');
|
|
24
|
-
if (!params)
|
|
25
|
-
return undefined;
|
|
26
|
-
let sig = (0, tree_sitter_helpers_1.getNodeText)(params, source);
|
|
27
|
-
if (result) {
|
|
28
|
-
sig += ' ' + (0, tree_sitter_helpers_1.getNodeText)(result, source);
|
|
29
|
-
}
|
|
30
|
-
return sig;
|
|
31
|
-
},
|
|
32
|
-
resolveTypeAliasKind: (node, _source) => {
|
|
33
|
-
// Go type_spec: `type Foo struct { ... }` or `type Bar interface { ... }`
|
|
34
|
-
// The inner type is in the 'type' field of the type_spec node
|
|
35
|
-
const typeChild = (0, tree_sitter_helpers_1.getChildByField)(node, 'type');
|
|
36
|
-
if (!typeChild)
|
|
37
|
-
return undefined;
|
|
38
|
-
if (typeChild.type === 'struct_type')
|
|
39
|
-
return 'struct';
|
|
40
|
-
if (typeChild.type === 'interface_type')
|
|
41
|
-
return 'interface';
|
|
42
|
-
return undefined;
|
|
43
|
-
},
|
|
44
|
-
getReceiverType: (node, source) => {
|
|
45
|
-
// Go method_declaration has a "receiver" field: func (sl *scrapeLoop) run(...)
|
|
46
|
-
// The receiver is a parameter_list containing a parameter_declaration
|
|
47
|
-
// with a type that may be a pointer_type (*scrapeLoop) or plain type (scrapeLoop)
|
|
48
|
-
const receiver = (0, tree_sitter_helpers_1.getChildByField)(node, 'receiver');
|
|
49
|
-
if (!receiver)
|
|
50
|
-
return undefined;
|
|
51
|
-
// Find the type identifier inside the receiver
|
|
52
|
-
const text = (0, tree_sitter_helpers_1.getNodeText)(receiver, source);
|
|
53
|
-
// Extract type name from patterns like "(sl *Type)", "(sl Type)", "(*Type)", "(Type)"
|
|
54
|
-
const match = text.match(/\*?\s*([A-Za-z_][A-Za-z0-9_]*)\s*\)/);
|
|
55
|
-
return match?.[1];
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=go.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-language extraction configurations.
|
|
3
|
-
*
|
|
4
|
-
* Each file exports a LanguageExtractor config object.
|
|
5
|
-
* This barrel builds the EXTRACTORS map consumed by TreeSitterExtractor.
|
|
6
|
-
*/
|
|
7
|
-
import { Language } from '../../types'
|
|
8
|
-
import type { LanguageExtractor } from '../tree-sitter-types'
|
|
9
|
-
export declare const EXTRACTORS: Partial<Record<Language, LanguageExtractor>>
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Per-language extraction configurations.
|
|
4
|
-
*
|
|
5
|
-
* Each file exports a LanguageExtractor config object.
|
|
6
|
-
* This barrel builds the EXTRACTORS map consumed by TreeSitterExtractor.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.EXTRACTORS = void 0;
|
|
10
|
-
const typescript_1 = require("./typescript");
|
|
11
|
-
const javascript_1 = require("./javascript");
|
|
12
|
-
const python_1 = require("./python");
|
|
13
|
-
const go_1 = require("./go");
|
|
14
|
-
const rust_1 = require("./rust");
|
|
15
|
-
const java_1 = require("./java");
|
|
16
|
-
const c_cpp_1 = require("./c-cpp");
|
|
17
|
-
const csharp_1 = require("./csharp");
|
|
18
|
-
const php_1 = require("./php");
|
|
19
|
-
const ruby_1 = require("./ruby");
|
|
20
|
-
const swift_1 = require("./swift");
|
|
21
|
-
const kotlin_1 = require("./kotlin");
|
|
22
|
-
const dart_1 = require("./dart");
|
|
23
|
-
const pascal_1 = require("./pascal");
|
|
24
|
-
const scala_1 = require("./scala");
|
|
25
|
-
const lua_1 = require("./lua");
|
|
26
|
-
const luau_1 = require("./luau");
|
|
27
|
-
exports.EXTRACTORS = {
|
|
28
|
-
typescript: typescript_1.typescriptExtractor,
|
|
29
|
-
tsx: typescript_1.typescriptExtractor,
|
|
30
|
-
javascript: javascript_1.javascriptExtractor,
|
|
31
|
-
jsx: javascript_1.javascriptExtractor,
|
|
32
|
-
python: python_1.pythonExtractor,
|
|
33
|
-
go: go_1.goExtractor,
|
|
34
|
-
rust: rust_1.rustExtractor,
|
|
35
|
-
java: java_1.javaExtractor,
|
|
36
|
-
c: c_cpp_1.cExtractor,
|
|
37
|
-
cpp: c_cpp_1.cppExtractor,
|
|
38
|
-
csharp: csharp_1.csharpExtractor,
|
|
39
|
-
php: php_1.phpExtractor,
|
|
40
|
-
ruby: ruby_1.rubyExtractor,
|
|
41
|
-
swift: swift_1.swiftExtractor,
|
|
42
|
-
kotlin: kotlin_1.kotlinExtractor,
|
|
43
|
-
dart: dart_1.dartExtractor,
|
|
44
|
-
pascal: pascal_1.pascalExtractor,
|
|
45
|
-
scala: scala_1.scalaExtractor,
|
|
46
|
-
lua: lua_1.luaExtractor,
|
|
47
|
-
luau: luau_1.luauExtractor,
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.javaExtractor = void 0;
|
|
4
|
-
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
-
exports.javaExtractor = {
|
|
6
|
-
functionTypes: [],
|
|
7
|
-
classTypes: ['class_declaration'],
|
|
8
|
-
methodTypes: ['method_declaration', 'constructor_declaration'],
|
|
9
|
-
interfaceTypes: ['interface_declaration'],
|
|
10
|
-
structTypes: [],
|
|
11
|
-
enumTypes: ['enum_declaration'],
|
|
12
|
-
enumMemberTypes: ['enum_constant'],
|
|
13
|
-
typeAliasTypes: [],
|
|
14
|
-
importTypes: ['import_declaration'],
|
|
15
|
-
callTypes: ['method_invocation'],
|
|
16
|
-
variableTypes: ['local_variable_declaration'],
|
|
17
|
-
fieldTypes: ['field_declaration'],
|
|
18
|
-
nameField: 'name',
|
|
19
|
-
bodyField: 'body',
|
|
20
|
-
paramsField: 'parameters',
|
|
21
|
-
returnField: 'type',
|
|
22
|
-
getSignature: (node, source) => {
|
|
23
|
-
const params = (0, tree_sitter_helpers_1.getChildByField)(node, 'parameters');
|
|
24
|
-
const returnType = (0, tree_sitter_helpers_1.getChildByField)(node, 'type');
|
|
25
|
-
if (!params)
|
|
26
|
-
return undefined;
|
|
27
|
-
const paramsText = (0, tree_sitter_helpers_1.getNodeText)(params, source);
|
|
28
|
-
return returnType ? (0, tree_sitter_helpers_1.getNodeText)(returnType, source) + ' ' + paramsText : paramsText;
|
|
29
|
-
},
|
|
30
|
-
getVisibility: (node) => {
|
|
31
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
32
|
-
const child = node.child(i);
|
|
33
|
-
if (child?.type === 'modifiers') {
|
|
34
|
-
const text = child.text;
|
|
35
|
-
if (text.includes('public'))
|
|
36
|
-
return 'public';
|
|
37
|
-
if (text.includes('private'))
|
|
38
|
-
return 'private';
|
|
39
|
-
if (text.includes('protected'))
|
|
40
|
-
return 'protected';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
},
|
|
45
|
-
isStatic: (node) => {
|
|
46
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
47
|
-
const child = node.child(i);
|
|
48
|
-
if (child?.type === 'modifiers' && child.text.includes('static')) {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
},
|
|
54
|
-
extractImport: (node, source) => {
|
|
55
|
-
const importText = source.substring(node.startIndex, node.endIndex).trim();
|
|
56
|
-
const scopedId = node.namedChildren.find((c) => c.type === 'scoped_identifier');
|
|
57
|
-
if (scopedId) {
|
|
58
|
-
const moduleName = source.substring(scopedId.startIndex, scopedId.endIndex);
|
|
59
|
-
return { moduleName, signature: importText };
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=java.js.map
|