gitnexus 1.6.2-rc.12 → 1.6.2-rc.14
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/dist/core/ingestion/class-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +11 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.js +21 -0
- package/dist/core/ingestion/class-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/dart.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.js +35 -0
- package/dist/core/ingestion/class-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/php.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/python.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/rust.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/swift.js +18 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.d.ts +4 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.js +28 -0
- package/dist/core/ingestion/languages/c-cpp.js +3 -9
- package/dist/core/ingestion/languages/csharp.js +2 -19
- package/dist/core/ingestion/languages/dart.js +2 -5
- package/dist/core/ingestion/languages/go.js +2 -18
- package/dist/core/ingestion/languages/java.js +2 -16
- package/dist/core/ingestion/languages/kotlin.js +2 -11
- package/dist/core/ingestion/languages/php.js +2 -5
- package/dist/core/ingestion/languages/python.js +2 -5
- package/dist/core/ingestion/languages/ruby.js +2 -5
- package/dist/core/ingestion/languages/rust.js +2 -5
- package/dist/core/ingestion/languages/swift.js +2 -16
- package/dist/core/ingestion/languages/typescript.js +3 -20
- package/dist/core/ingestion/languages/vue.js +2 -15
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/c-cpp.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const cClassConfig = {
|
|
4
|
+
language: SupportedLanguages.C,
|
|
5
|
+
typeDeclarationNodes: ['struct_specifier', 'enum_specifier'],
|
|
6
|
+
};
|
|
7
|
+
export const cppClassConfig = {
|
|
8
|
+
language: SupportedLanguages.CPlusPlus,
|
|
9
|
+
typeDeclarationNodes: ['class_specifier', 'struct_specifier', 'enum_specifier'],
|
|
10
|
+
ancestorScopeNodeTypes: ['namespace_definition', 'class_specifier', 'struct_specifier'],
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/csharp.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const csharpClassConfig = {
|
|
4
|
+
language: SupportedLanguages.CSharp,
|
|
5
|
+
typeDeclarationNodes: [
|
|
6
|
+
'class_declaration',
|
|
7
|
+
'interface_declaration',
|
|
8
|
+
'struct_declaration',
|
|
9
|
+
'enum_declaration',
|
|
10
|
+
'record_declaration',
|
|
11
|
+
],
|
|
12
|
+
fileScopeNodeTypes: ['file_scoped_namespace_declaration'],
|
|
13
|
+
ancestorScopeNodeTypes: [
|
|
14
|
+
'namespace_declaration',
|
|
15
|
+
'class_declaration',
|
|
16
|
+
'interface_declaration',
|
|
17
|
+
'struct_declaration',
|
|
18
|
+
'enum_declaration',
|
|
19
|
+
'record_declaration',
|
|
20
|
+
],
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/dart.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const dartClassConfig = {
|
|
4
|
+
language: SupportedLanguages.Dart,
|
|
5
|
+
typeDeclarationNodes: ['class_definition', 'extension_declaration', 'enum_declaration'],
|
|
6
|
+
ancestorScopeNodeTypes: ['class_definition', 'extension_declaration', 'enum_declaration'],
|
|
7
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/go.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const goClassConfig = {
|
|
4
|
+
language: SupportedLanguages.Go,
|
|
5
|
+
typeDeclarationNodes: ['type_declaration'],
|
|
6
|
+
fileScopeNodeTypes: ['package_clause'],
|
|
7
|
+
extractName(node) {
|
|
8
|
+
const typeSpec = node.namedChildren.find((child) => child.type === 'type_spec');
|
|
9
|
+
return typeSpec?.childForFieldName('name')?.text;
|
|
10
|
+
},
|
|
11
|
+
extractType(node) {
|
|
12
|
+
const typeSpec = node.namedChildren.find((child) => child.type === 'type_spec');
|
|
13
|
+
const typeNode = typeSpec?.childForFieldName('type');
|
|
14
|
+
if (typeNode?.type === 'struct_type')
|
|
15
|
+
return 'Struct';
|
|
16
|
+
if (typeNode?.type === 'interface_type')
|
|
17
|
+
return 'Interface';
|
|
18
|
+
return undefined;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/jvm.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Java
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
export const javaClassConfig = {
|
|
7
|
+
language: SupportedLanguages.Java,
|
|
8
|
+
typeDeclarationNodes: [
|
|
9
|
+
'class_declaration',
|
|
10
|
+
'interface_declaration',
|
|
11
|
+
'enum_declaration',
|
|
12
|
+
'record_declaration',
|
|
13
|
+
],
|
|
14
|
+
fileScopeNodeTypes: ['package_declaration'],
|
|
15
|
+
ancestorScopeNodeTypes: [
|
|
16
|
+
'class_declaration',
|
|
17
|
+
'interface_declaration',
|
|
18
|
+
'enum_declaration',
|
|
19
|
+
'record_declaration',
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Kotlin
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
export const kotlinClassConfig = {
|
|
26
|
+
language: SupportedLanguages.Kotlin,
|
|
27
|
+
typeDeclarationNodes: ['class_declaration', 'object_declaration', 'companion_object'],
|
|
28
|
+
fileScopeNodeTypes: ['package_header'],
|
|
29
|
+
ancestorScopeNodeTypes: ['class_declaration', 'object_declaration', 'companion_object'],
|
|
30
|
+
extractType(node) {
|
|
31
|
+
if (node.type !== 'class_declaration')
|
|
32
|
+
return undefined;
|
|
33
|
+
return node.children.some((child) => child?.text === 'interface') ? 'Interface' : 'Class';
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/php.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const phpClassConfig = {
|
|
4
|
+
language: SupportedLanguages.PHP,
|
|
5
|
+
typeDeclarationNodes: ['class_declaration', 'interface_declaration', 'enum_declaration'],
|
|
6
|
+
ancestorScopeNodeTypes: ['namespace_definition'],
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/python.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const pythonClassConfig = {
|
|
4
|
+
language: SupportedLanguages.Python,
|
|
5
|
+
typeDeclarationNodes: ['class_definition'],
|
|
6
|
+
ancestorScopeNodeTypes: ['class_definition'],
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/ruby.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const rubyClassConfig = {
|
|
4
|
+
language: SupportedLanguages.Ruby,
|
|
5
|
+
typeDeclarationNodes: ['class'],
|
|
6
|
+
ancestorScopeNodeTypes: ['module', 'class'],
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/rust.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const rustClassConfig = {
|
|
4
|
+
language: SupportedLanguages.Rust,
|
|
5
|
+
typeDeclarationNodes: ['struct_item', 'enum_item'],
|
|
6
|
+
ancestorScopeNodeTypes: ['mod_item', 'struct_item', 'enum_item'],
|
|
7
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/swift.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
export const swiftClassConfig = {
|
|
4
|
+
language: SupportedLanguages.Swift,
|
|
5
|
+
typeDeclarationNodes: ['class_declaration', 'protocol_declaration'],
|
|
6
|
+
ancestorScopeNodeTypes: ['class_declaration', 'protocol_declaration'],
|
|
7
|
+
extractType(node) {
|
|
8
|
+
if (node.type === 'protocol_declaration')
|
|
9
|
+
return 'Interface';
|
|
10
|
+
if (node.type !== 'class_declaration')
|
|
11
|
+
return undefined;
|
|
12
|
+
if (node.children.some((child) => child?.text === 'struct'))
|
|
13
|
+
return 'Struct';
|
|
14
|
+
if (node.children.some((child) => child?.text === 'enum'))
|
|
15
|
+
return 'Enum';
|
|
16
|
+
return 'Class';
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// gitnexus/src/core/ingestion/class-extractors/configs/typescript-javascript.ts
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
const shared = {
|
|
4
|
+
typeDeclarationNodes: [
|
|
5
|
+
'class_declaration',
|
|
6
|
+
'abstract_class_declaration',
|
|
7
|
+
'interface_declaration',
|
|
8
|
+
'enum_declaration',
|
|
9
|
+
],
|
|
10
|
+
ancestorScopeNodeTypes: [
|
|
11
|
+
'class_declaration',
|
|
12
|
+
'abstract_class_declaration',
|
|
13
|
+
'interface_declaration',
|
|
14
|
+
'enum_declaration',
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
export const typescriptClassConfig = {
|
|
18
|
+
...shared,
|
|
19
|
+
language: SupportedLanguages.TypeScript,
|
|
20
|
+
};
|
|
21
|
+
export const javascriptClassConfig = {
|
|
22
|
+
...shared,
|
|
23
|
+
language: SupportedLanguages.JavaScript,
|
|
24
|
+
};
|
|
25
|
+
export const vueClassConfig = {
|
|
26
|
+
...shared,
|
|
27
|
+
language: SupportedLanguages.Vue,
|
|
28
|
+
};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
11
11
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
12
|
+
import { cClassConfig, cppClassConfig } from '../class-extractors/configs/c-cpp.js';
|
|
12
13
|
import { defineLanguage } from '../language-provider.js';
|
|
13
14
|
import { typeConfig as cCppConfig } from '../type-extractors/c-cpp.js';
|
|
14
15
|
import { cCppExportChecker } from '../export-detection.js';
|
|
@@ -135,15 +136,8 @@ const C_BUILT_INS = new Set([
|
|
|
135
136
|
'get',
|
|
136
137
|
'put',
|
|
137
138
|
]);
|
|
138
|
-
const cClassExtractor = createClassExtractor(
|
|
139
|
-
|
|
140
|
-
typeDeclarationNodes: ['struct_specifier', 'enum_specifier'],
|
|
141
|
-
});
|
|
142
|
-
const cppClassExtractor = createClassExtractor({
|
|
143
|
-
language: SupportedLanguages.CPlusPlus,
|
|
144
|
-
typeDeclarationNodes: ['class_specifier', 'struct_specifier', 'enum_specifier'],
|
|
145
|
-
ancestorScopeNodeTypes: ['namespace_definition', 'class_specifier', 'struct_specifier'],
|
|
146
|
-
});
|
|
139
|
+
const cClassExtractor = createClassExtractor(cClassConfig);
|
|
140
|
+
const cppClassExtractor = createClassExtractor(cppClassConfig);
|
|
147
141
|
/**
|
|
148
142
|
* C/C++ function name extraction — unwraps pointer_declarator / reference_declarator /
|
|
149
143
|
* function_declarator / qualified_identifier chains to find the actual function name.
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
9
9
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
10
|
+
import { csharpClassConfig } from '../class-extractors/configs/csharp.js';
|
|
10
11
|
import { defineLanguage } from '../language-provider.js';
|
|
11
12
|
import { typeConfig as csharpConfig } from '../type-extractors/csharp.js';
|
|
12
13
|
import { csharpExportChecker } from '../export-detection.js';
|
|
@@ -123,24 +124,6 @@ export const csharpProvider = defineLanguage({
|
|
|
123
124
|
mroStrategy: 'implements-split',
|
|
124
125
|
fieldExtractor: createFieldExtractor(csharpFieldConfig),
|
|
125
126
|
methodExtractor: createMethodExtractor(csharpMethodConfig),
|
|
126
|
-
classExtractor: createClassExtractor(
|
|
127
|
-
language: SupportedLanguages.CSharp,
|
|
128
|
-
typeDeclarationNodes: [
|
|
129
|
-
'class_declaration',
|
|
130
|
-
'interface_declaration',
|
|
131
|
-
'struct_declaration',
|
|
132
|
-
'enum_declaration',
|
|
133
|
-
'record_declaration',
|
|
134
|
-
],
|
|
135
|
-
fileScopeNodeTypes: ['file_scoped_namespace_declaration'],
|
|
136
|
-
ancestorScopeNodeTypes: [
|
|
137
|
-
'namespace_declaration',
|
|
138
|
-
'class_declaration',
|
|
139
|
-
'interface_declaration',
|
|
140
|
-
'struct_declaration',
|
|
141
|
-
'enum_declaration',
|
|
142
|
-
'record_declaration',
|
|
143
|
-
],
|
|
144
|
-
}),
|
|
127
|
+
classExtractor: createClassExtractor(csharpClassConfig),
|
|
145
128
|
builtInNames: BUILT_INS,
|
|
146
129
|
});
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { FUNCTION_NODE_TYPES } from '../utils/ast-helpers.js';
|
|
13
13
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
14
14
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
15
|
+
import { dartClassConfig } from '../class-extractors/configs/dart.js';
|
|
15
16
|
import { defineLanguage } from '../language-provider.js';
|
|
16
17
|
import { typeConfig as dartConfig } from '../type-extractors/dart.js';
|
|
17
18
|
import { dartExportChecker } from '../export-detection.js';
|
|
@@ -86,11 +87,7 @@ export const dartProvider = defineLanguage({
|
|
|
86
87
|
importSemantics: 'wildcard-leaf',
|
|
87
88
|
fieldExtractor: createFieldExtractor(dartFieldConfig),
|
|
88
89
|
methodExtractor: createMethodExtractor(dartMethodConfig),
|
|
89
|
-
classExtractor: createClassExtractor(
|
|
90
|
-
language: SupportedLanguages.Dart,
|
|
91
|
-
typeDeclarationNodes: ['class_definition', 'extension_declaration', 'enum_declaration'],
|
|
92
|
-
ancestorScopeNodeTypes: ['class_definition', 'extension_declaration', 'enum_declaration'],
|
|
93
|
-
}),
|
|
90
|
+
classExtractor: createClassExtractor(dartClassConfig),
|
|
94
91
|
enclosingFunctionFinder: dartEnclosingFunctionFinder,
|
|
95
92
|
builtInNames: BUILT_INS,
|
|
96
93
|
});
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
12
12
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
13
|
+
import { goClassConfig } from '../class-extractors/configs/go.js';
|
|
13
14
|
import { defineLanguage } from '../language-provider.js';
|
|
14
15
|
import { typeConfig as goConfig } from '../type-extractors/go.js';
|
|
15
16
|
import { goExportChecker } from '../export-detection.js';
|
|
@@ -29,22 +30,5 @@ export const goProvider = defineLanguage({
|
|
|
29
30
|
importSemantics: 'wildcard-leaf',
|
|
30
31
|
fieldExtractor: createFieldExtractor(goFieldConfig),
|
|
31
32
|
methodExtractor: createMethodExtractor(goMethodConfig),
|
|
32
|
-
classExtractor: createClassExtractor(
|
|
33
|
-
language: SupportedLanguages.Go,
|
|
34
|
-
typeDeclarationNodes: ['type_declaration'],
|
|
35
|
-
fileScopeNodeTypes: ['package_clause'],
|
|
36
|
-
extractName(node) {
|
|
37
|
-
const typeSpec = node.namedChildren.find((child) => child.type === 'type_spec');
|
|
38
|
-
return typeSpec?.childForFieldName('name')?.text;
|
|
39
|
-
},
|
|
40
|
-
extractType(node) {
|
|
41
|
-
const typeSpec = node.namedChildren.find((child) => child.type === 'type_spec');
|
|
42
|
-
const typeNode = typeSpec?.childForFieldName('type');
|
|
43
|
-
if (typeNode?.type === 'struct_type')
|
|
44
|
-
return 'Struct';
|
|
45
|
-
if (typeNode?.type === 'interface_type')
|
|
46
|
-
return 'Interface';
|
|
47
|
-
return undefined;
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
33
|
+
classExtractor: createClassExtractor(goClassConfig),
|
|
50
34
|
});
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
11
|
+
import { javaClassConfig } from '../class-extractors/configs/jvm.js';
|
|
11
12
|
import { defineLanguage } from '../language-provider.js';
|
|
12
13
|
import { javaTypeConfig } from '../type-extractors/jvm.js';
|
|
13
14
|
import { javaExportChecker } from '../export-detection.js';
|
|
@@ -30,20 +31,5 @@ export const javaProvider = defineLanguage({
|
|
|
30
31
|
mroStrategy: 'implements-split',
|
|
31
32
|
fieldExtractor: createFieldExtractor(javaConfig),
|
|
32
33
|
methodExtractor: createMethodExtractor(javaMethodConfig),
|
|
33
|
-
classExtractor: createClassExtractor(
|
|
34
|
-
language: SupportedLanguages.Java,
|
|
35
|
-
typeDeclarationNodes: [
|
|
36
|
-
'class_declaration',
|
|
37
|
-
'interface_declaration',
|
|
38
|
-
'enum_declaration',
|
|
39
|
-
'record_declaration',
|
|
40
|
-
],
|
|
41
|
-
fileScopeNodeTypes: ['package_declaration'],
|
|
42
|
-
ancestorScopeNodeTypes: [
|
|
43
|
-
'class_declaration',
|
|
44
|
-
'interface_declaration',
|
|
45
|
-
'enum_declaration',
|
|
46
|
-
'record_declaration',
|
|
47
|
-
],
|
|
48
|
-
}),
|
|
34
|
+
classExtractor: createClassExtractor(javaClassConfig),
|
|
49
35
|
});
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
11
|
+
import { kotlinClassConfig } from '../class-extractors/configs/jvm.js';
|
|
11
12
|
import { defineLanguage } from '../language-provider.js';
|
|
12
13
|
import { kotlinTypeConfig } from '../type-extractors/jvm.js';
|
|
13
14
|
import { kotlinExportChecker } from '../export-detection.js';
|
|
@@ -101,17 +102,7 @@ export const kotlinProvider = defineLanguage({
|
|
|
101
102
|
mroStrategy: 'implements-split',
|
|
102
103
|
fieldExtractor: createFieldExtractor(kotlinConfig),
|
|
103
104
|
methodExtractor: createMethodExtractor(kotlinMethodConfig),
|
|
104
|
-
classExtractor: createClassExtractor(
|
|
105
|
-
language: SupportedLanguages.Kotlin,
|
|
106
|
-
typeDeclarationNodes: ['class_declaration', 'object_declaration', 'companion_object'],
|
|
107
|
-
fileScopeNodeTypes: ['package_header'],
|
|
108
|
-
ancestorScopeNodeTypes: ['class_declaration', 'object_declaration', 'companion_object'],
|
|
109
|
-
extractType(node) {
|
|
110
|
-
if (node.type !== 'class_declaration')
|
|
111
|
-
return undefined;
|
|
112
|
-
return node.children.some((child) => child?.text === 'interface') ? 'Interface' : 'Class';
|
|
113
|
-
},
|
|
114
|
-
}),
|
|
105
|
+
classExtractor: createClassExtractor(kotlinClassConfig),
|
|
115
106
|
builtInNames: BUILT_INS,
|
|
116
107
|
labelOverride: (functionNode, defaultLabel) => {
|
|
117
108
|
if (defaultLabel !== 'Function')
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
9
9
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
10
|
+
import { phpClassConfig } from '../class-extractors/configs/php.js';
|
|
10
11
|
import { defineLanguage } from '../language-provider.js';
|
|
11
12
|
import { typeConfig as phpConfig } from '../type-extractors/php.js';
|
|
12
13
|
import { phpExportChecker } from '../export-detection.js';
|
|
@@ -223,11 +224,7 @@ export const phpProvider = defineLanguage({
|
|
|
223
224
|
namedBindingExtractor: extractPhpNamedBindings,
|
|
224
225
|
fieldExtractor: createFieldExtractor(phpFieldConfig),
|
|
225
226
|
methodExtractor: createMethodExtractor(phpMethodConfig),
|
|
226
|
-
classExtractor: createClassExtractor(
|
|
227
|
-
language: SupportedLanguages.PHP,
|
|
228
|
-
typeDeclarationNodes: ['class_declaration', 'interface_declaration', 'enum_declaration'],
|
|
229
|
-
ancestorScopeNodeTypes: ['namespace_definition'],
|
|
230
|
-
}),
|
|
227
|
+
classExtractor: createClassExtractor(phpClassConfig),
|
|
231
228
|
descriptionExtractor: phpDescriptionExtractor,
|
|
232
229
|
isRouteFile: isPhpRouteFile,
|
|
233
230
|
builtInNames: BUILT_INS,
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
14
|
+
import { pythonClassConfig } from '../class-extractors/configs/python.js';
|
|
14
15
|
import { defineLanguage } from '../language-provider.js';
|
|
15
16
|
import { typeConfig as pythonConfig } from '../type-extractors/python.js';
|
|
16
17
|
import { pythonExportChecker } from '../export-detection.js';
|
|
@@ -62,10 +63,6 @@ export const pythonProvider = defineLanguage({
|
|
|
62
63
|
mroStrategy: 'c3',
|
|
63
64
|
fieldExtractor: createFieldExtractor(pythonFieldConfig),
|
|
64
65
|
methodExtractor: createMethodExtractor(pythonMethodConfig),
|
|
65
|
-
classExtractor: createClassExtractor(
|
|
66
|
-
language: SupportedLanguages.Python,
|
|
67
|
-
typeDeclarationNodes: ['class_definition'],
|
|
68
|
-
ancestorScopeNodeTypes: ['class_definition'],
|
|
69
|
-
}),
|
|
66
|
+
classExtractor: createClassExtractor(pythonClassConfig),
|
|
70
67
|
builtInNames: BUILT_INS,
|
|
71
68
|
});
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
11
|
+
import { rubyClassConfig } from '../class-extractors/configs/ruby.js';
|
|
11
12
|
import { defineLanguage } from '../language-provider.js';
|
|
12
13
|
import { typeConfig as rubyConfig } from '../type-extractors/ruby.js';
|
|
13
14
|
import { routeRubyCall } from '../call-routing.js';
|
|
@@ -120,10 +121,6 @@ export const rubyProvider = defineLanguage({
|
|
|
120
121
|
...rubyMethodConfig,
|
|
121
122
|
extractFunctionName: rubyExtractFunctionName,
|
|
122
123
|
}),
|
|
123
|
-
classExtractor: createClassExtractor(
|
|
124
|
-
language: SupportedLanguages.Ruby,
|
|
125
|
-
typeDeclarationNodes: ['class'],
|
|
126
|
-
ancestorScopeNodeTypes: ['module', 'class'],
|
|
127
|
-
}),
|
|
124
|
+
classExtractor: createClassExtractor(rubyClassConfig),
|
|
128
125
|
builtInNames: BUILT_INS,
|
|
129
126
|
});
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
14
|
+
import { rustClassConfig } from '../class-extractors/configs/rust.js';
|
|
14
15
|
import { defineLanguage } from '../language-provider.js';
|
|
15
16
|
import { typeConfig as rustConfig } from '../type-extractors/rust.js';
|
|
16
17
|
import { rustExportChecker } from '../export-detection.js';
|
|
@@ -117,10 +118,6 @@ export const rustProvider = defineLanguage({
|
|
|
117
118
|
...rustMethodConfig,
|
|
118
119
|
extractFunctionName: rustExtractFunctionName,
|
|
119
120
|
}),
|
|
120
|
-
classExtractor: createClassExtractor(
|
|
121
|
-
language: SupportedLanguages.Rust,
|
|
122
|
-
typeDeclarationNodes: ['struct_item', 'enum_item'],
|
|
123
|
-
ancestorScopeNodeTypes: ['mod_item', 'struct_item', 'enum_item'],
|
|
124
|
-
}),
|
|
121
|
+
classExtractor: createClassExtractor(rustClassConfig),
|
|
125
122
|
builtInNames: BUILT_INS,
|
|
126
123
|
});
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
14
|
+
import { swiftClassConfig } from '../class-extractors/configs/swift.js';
|
|
14
15
|
import { defineLanguage } from '../language-provider.js';
|
|
15
16
|
import { typeConfig as swiftConfig } from '../type-extractors/swift.js';
|
|
16
17
|
import { swiftExportChecker } from '../export-detection.js';
|
|
@@ -228,22 +229,7 @@ export const swiftProvider = defineLanguage({
|
|
|
228
229
|
...swiftMethodConfig,
|
|
229
230
|
extractFunctionName: swiftExtractFunctionName,
|
|
230
231
|
}),
|
|
231
|
-
classExtractor: createClassExtractor(
|
|
232
|
-
language: SupportedLanguages.Swift,
|
|
233
|
-
typeDeclarationNodes: ['class_declaration', 'protocol_declaration'],
|
|
234
|
-
ancestorScopeNodeTypes: ['class_declaration', 'protocol_declaration'],
|
|
235
|
-
extractType(node) {
|
|
236
|
-
if (node.type === 'protocol_declaration')
|
|
237
|
-
return 'Interface';
|
|
238
|
-
if (node.type !== 'class_declaration')
|
|
239
|
-
return undefined;
|
|
240
|
-
if (node.children.some((child) => child?.text === 'struct'))
|
|
241
|
-
return 'Struct';
|
|
242
|
-
if (node.children.some((child) => child?.text === 'enum'))
|
|
243
|
-
return 'Enum';
|
|
244
|
-
return 'Class';
|
|
245
|
-
},
|
|
246
|
-
}),
|
|
232
|
+
classExtractor: createClassExtractor(swiftClassConfig),
|
|
247
233
|
implicitImportWirer: wireSwiftImplicitImports,
|
|
248
234
|
builtInNames: BUILT_INS,
|
|
249
235
|
});
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { defineLanguage } from '../language-provider.js';
|
|
11
11
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
12
|
+
import { typescriptClassConfig, javascriptClassConfig, } from '../class-extractors/configs/typescript-javascript.js';
|
|
12
13
|
import { typeConfig as typescriptConfig } from '../type-extractors/typescript.js';
|
|
13
14
|
import { tsExportChecker } from '../export-detection.js';
|
|
14
15
|
import { resolveTypescriptImport, resolveJavascriptImport } from '../import-resolvers/standard.js';
|
|
@@ -137,21 +138,6 @@ export const BUILT_INS = new Set([
|
|
|
137
138
|
'toString',
|
|
138
139
|
'valueOf',
|
|
139
140
|
]);
|
|
140
|
-
const tsJsClassConfig = {
|
|
141
|
-
language: SupportedLanguages.TypeScript,
|
|
142
|
-
typeDeclarationNodes: [
|
|
143
|
-
'class_declaration',
|
|
144
|
-
'abstract_class_declaration',
|
|
145
|
-
'interface_declaration',
|
|
146
|
-
'enum_declaration',
|
|
147
|
-
],
|
|
148
|
-
ancestorScopeNodeTypes: [
|
|
149
|
-
'class_declaration',
|
|
150
|
-
'abstract_class_declaration',
|
|
151
|
-
'interface_declaration',
|
|
152
|
-
'enum_declaration',
|
|
153
|
-
],
|
|
154
|
-
};
|
|
155
141
|
export const typescriptProvider = defineLanguage({
|
|
156
142
|
id: SupportedLanguages.TypeScript,
|
|
157
143
|
extensions: ['.ts', '.tsx'],
|
|
@@ -165,7 +151,7 @@ export const typescriptProvider = defineLanguage({
|
|
|
165
151
|
...typescriptMethodConfig,
|
|
166
152
|
extractFunctionName: tsExtractFunctionName,
|
|
167
153
|
}),
|
|
168
|
-
classExtractor: createClassExtractor(
|
|
154
|
+
classExtractor: createClassExtractor(typescriptClassConfig),
|
|
169
155
|
builtInNames: BUILT_INS,
|
|
170
156
|
});
|
|
171
157
|
export const javascriptProvider = defineLanguage({
|
|
@@ -181,9 +167,6 @@ export const javascriptProvider = defineLanguage({
|
|
|
181
167
|
...javascriptMethodConfig,
|
|
182
168
|
extractFunctionName: tsExtractFunctionName,
|
|
183
169
|
}),
|
|
184
|
-
classExtractor: createClassExtractor(
|
|
185
|
-
...tsJsClassConfig,
|
|
186
|
-
language: SupportedLanguages.JavaScript,
|
|
187
|
-
}),
|
|
170
|
+
classExtractor: createClassExtractor(javascriptClassConfig),
|
|
188
171
|
builtInNames: BUILT_INS,
|
|
189
172
|
});
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
14
14
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
15
|
+
import { vueClassConfig } from '../class-extractors/configs/typescript-javascript.js';
|
|
15
16
|
import { defineLanguage } from '../language-provider.js';
|
|
16
17
|
import { typeConfig as typescriptConfig } from '../type-extractors/typescript.js';
|
|
17
18
|
import { tsExportChecker } from '../export-detection.js';
|
|
@@ -52,21 +53,7 @@ const VUE_SPECIFIC_BUILT_INS = [
|
|
|
52
53
|
'useAttrs',
|
|
53
54
|
];
|
|
54
55
|
const VUE_BUILT_INS = new Set([...TS_BUILT_INS, ...VUE_SPECIFIC_BUILT_INS]);
|
|
55
|
-
const vueClassExtractor = createClassExtractor(
|
|
56
|
-
language: SupportedLanguages.Vue,
|
|
57
|
-
typeDeclarationNodes: [
|
|
58
|
-
'class_declaration',
|
|
59
|
-
'abstract_class_declaration',
|
|
60
|
-
'interface_declaration',
|
|
61
|
-
'enum_declaration',
|
|
62
|
-
],
|
|
63
|
-
ancestorScopeNodeTypes: [
|
|
64
|
-
'class_declaration',
|
|
65
|
-
'abstract_class_declaration',
|
|
66
|
-
'interface_declaration',
|
|
67
|
-
'enum_declaration',
|
|
68
|
-
],
|
|
69
|
-
});
|
|
56
|
+
const vueClassExtractor = createClassExtractor(vueClassConfig);
|
|
70
57
|
export const vueProvider = defineLanguage({
|
|
71
58
|
id: SupportedLanguages.Vue,
|
|
72
59
|
extensions: ['.vue'],
|
package/package.json
CHANGED