ts2famix 1.0.17 → 1.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/README.md +3 -3
- package/dist/analyze.js +8 -5
- package/dist/analyze_functions/processAccesses.js +7 -6
- package/dist/analyze_functions/processFiles.js +43 -43
- package/dist/analyze_functions/processImportClauses.js +25 -7
- package/dist/analyze_functions/processInheritances.js +8 -7
- package/dist/analyze_functions/processInvocations.js +6 -5
- package/dist/famix_functions/famix_functions.js +19 -21
- package/dist/famix_functions/famix_functions_associations.js +29 -14
- package/dist/famix_functions/famix_functions_index.js +26 -15
- package/dist/famix_functions/famix_functions_types.js +2 -1
- package/dist/lib/famix/src/famix_repository.js +6 -0
- package/dist/lib/famix/src/model/famix/access.js +3 -3
- package/dist/lib/famix/src/model/famix/accessor.js +3 -3
- package/dist/lib/famix/src/model/famix/alias.js +3 -3
- package/dist/lib/famix/src/model/famix/association.js +3 -3
- package/dist/lib/famix/src/model/famix/behavioral_entity.js +6 -6
- package/dist/lib/famix/src/model/famix/class.js +3 -3
- package/dist/lib/famix/src/model/famix/comment.js +3 -3
- package/dist/lib/famix/src/model/famix/container_entity.js +3 -3
- package/dist/lib/famix/src/model/famix/decorator.js +3 -3
- package/dist/lib/famix/src/model/famix/entity.js +3 -3
- package/dist/lib/famix/src/model/famix/enum.js +3 -3
- package/dist/lib/famix/src/model/famix/enum_value.js +3 -3
- package/dist/lib/famix/src/model/famix/function.js +3 -3
- package/dist/lib/famix/src/model/famix/implicit_variable.js +3 -3
- package/dist/lib/famix/src/model/famix/import_clause.js +3 -3
- package/dist/lib/famix/src/model/famix/index.js +3 -7
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +3 -3
- package/dist/lib/famix/src/model/famix/inheritance.js +3 -3
- package/dist/lib/famix/src/model/famix/interface.js +3 -3
- package/dist/lib/famix/src/model/famix/invocation.js +3 -3
- package/dist/lib/famix/src/model/famix/method.js +3 -3
- package/dist/lib/famix/src/model/famix/module.js +3 -3
- package/dist/lib/famix/src/model/famix/named_entity.js +4 -4
- package/dist/lib/famix/src/model/famix/namespace.js +3 -3
- package/dist/lib/famix/src/model/famix/parameter.js +3 -3
- package/dist/lib/famix/src/model/famix/{type_parameter.js → parameter_type.js} +7 -7
- package/dist/lib/famix/src/model/famix/parameterizable_class.js +11 -11
- package/dist/lib/famix/src/model/famix/parameterizable_interface.js +11 -11
- package/dist/lib/famix/src/model/famix/parameterized_type.js +3 -3
- package/dist/lib/famix/src/model/famix/primitive_type.js +3 -3
- package/dist/lib/famix/src/model/famix/property.js +3 -3
- package/dist/lib/famix/src/model/famix/reference.js +3 -3
- package/dist/lib/famix/src/model/famix/scoping_entity.js +6 -5
- package/dist/lib/famix/src/model/famix/script_entity.js +3 -3
- package/dist/lib/famix/src/model/famix/source_anchor.js +3 -3
- package/dist/lib/famix/src/model/famix/source_language.js +8 -3
- package/dist/lib/famix/src/model/famix/sourced_entity.js +7 -3
- package/dist/lib/famix/src/model/famix/structural_entity.js +3 -3
- package/dist/lib/famix/src/model/famix/text_anchor.js +3 -3
- package/dist/lib/famix/src/model/famix/type.js +3 -3
- package/dist/lib/famix/src/model/famix/variable.js +3 -3
- package/dist/ts2famix-cli.js +16 -3
- package/package.json +14 -13
- package/src/analyze.ts +10 -4
- package/src/analyze_functions/processAccesses.ts +7 -6
- package/src/analyze_functions/processFiles.ts +44 -46
- package/src/analyze_functions/processImportClauses.ts +25 -7
- package/src/analyze_functions/processInheritances.ts +8 -7
- package/src/analyze_functions/processInvocations.ts +6 -5
- package/src/famix_functions/famix_functions.ts +20 -23
- package/src/famix_functions/famix_functions_associations.ts +32 -15
- package/src/famix_functions/famix_functions_index.ts +28 -18
- package/src/famix_functions/famix_functions_types.ts +2 -1
- package/src/generate_uml.sh +1 -0
- package/src/lib/famix/src/famix_repository.ts +12 -3
- package/src/lib/famix/src/model/famix/access.ts +3 -3
- package/src/lib/famix/src/model/famix/accessor.ts +3 -3
- package/src/lib/famix/src/model/famix/alias.ts +3 -3
- package/src/lib/famix/src/model/famix/association.ts +3 -3
- package/src/lib/famix/src/model/famix/behavioral_entity.ts +8 -8
- package/src/lib/famix/src/model/famix/class.ts +3 -3
- package/src/lib/famix/src/model/famix/comment.ts +3 -3
- package/src/lib/famix/src/model/famix/container_entity.ts +3 -3
- package/src/lib/famix/src/model/famix/decorator.ts +3 -3
- package/src/lib/famix/src/model/famix/entity.ts +3 -3
- package/src/lib/famix/src/model/famix/enum.ts +3 -3
- package/src/lib/famix/src/model/famix/enum_value.ts +3 -3
- package/src/lib/famix/src/model/famix/function.ts +3 -3
- package/src/lib/famix/src/model/famix/implicit_variable.ts +3 -3
- package/src/lib/famix/src/model/famix/import_clause.ts +3 -3
- package/src/lib/famix/src/model/famix/index.ts +40 -42
- package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +3 -3
- package/src/lib/famix/src/model/famix/inheritance.ts +3 -3
- package/src/lib/famix/src/model/famix/interface.ts +3 -3
- package/src/lib/famix/src/model/famix/invocation.ts +3 -3
- package/src/lib/famix/src/model/famix/method.ts +3 -3
- package/src/lib/famix/src/model/famix/module.ts +3 -3
- package/src/lib/famix/src/model/famix/named_entity.ts +4 -4
- package/src/lib/famix/src/model/famix/namespace.ts +3 -3
- package/src/lib/famix/src/model/famix/parameter.ts +3 -3
- package/src/lib/famix/src/model/famix/{type_parameter.ts → parameter_type.ts} +9 -9
- package/src/lib/famix/src/model/famix/parameterizable_class.ts +12 -12
- package/src/lib/famix/src/model/famix/parameterizable_interface.ts +12 -12
- package/src/lib/famix/src/model/famix/parameterized_type.ts +3 -3
- package/src/lib/famix/src/model/famix/primitive_type.ts +3 -3
- package/src/lib/famix/src/model/famix/property.ts +3 -3
- package/src/lib/famix/src/model/famix/reference.ts +3 -3
- package/src/lib/famix/src/model/famix/scoping_entity.ts +6 -5
- package/src/lib/famix/src/model/famix/script_entity.ts +3 -3
- package/src/lib/famix/src/model/famix/source_anchor.ts +3 -3
- package/src/lib/famix/src/model/famix/source_language.ts +9 -3
- package/src/lib/famix/src/model/famix/sourced_entity.ts +6 -3
- package/src/lib/famix/src/model/famix/structural_entity.ts +3 -3
- package/src/lib/famix/src/model/famix/text_anchor.ts +3 -3
- package/src/lib/famix/src/model/famix/type.ts +3 -3
- package/src/lib/famix/src/model/famix/variable.ts +3 -3
- package/src/ts2famix-cli.ts +17 -3
- package/dist/lib/famix/src/model/famix/c_source_language.js +0 -16
- package/dist/lib/famix/src/model/famix/custom_source_language.js +0 -23
- package/src/lib/famix/src/model/famix/c_source_language.ts +0 -15
- package/src/lib/famix/src/model/famix/custom_source_language.ts +0 -27
|
@@ -31,6 +31,7 @@ const fqn_1 = require("../fqn");
|
|
|
31
31
|
const famix_functions_index_1 = require("./famix_functions_index");
|
|
32
32
|
const famix_functions_associations_1 = require("./famix_functions_associations");
|
|
33
33
|
const famix_functions_types_1 = require("./famix_functions_types");
|
|
34
|
+
const analyze_1 = require("../analyze");
|
|
34
35
|
/**
|
|
35
36
|
* This class contains all the functions needed to create Famix entities
|
|
36
37
|
*/
|
|
@@ -115,7 +116,7 @@ class FamixFunctions {
|
|
|
115
116
|
fmxAlias = new Famix.Alias(this.famixRep);
|
|
116
117
|
fmxAlias.setName(a.getName());
|
|
117
118
|
const aliasNameWithGenerics = aliasName + (a.getTypeParameters().length ? ("<" + a.getTypeParameters().map(tp => tp.getName()).join(", ") + ">") : "");
|
|
118
|
-
|
|
119
|
+
analyze_1.logger.debug(`> NOTE: alias ${aliasName} has fully qualified name ${aliasFullyQualifiedName} and name with generics ${aliasNameWithGenerics}.`);
|
|
119
120
|
const fmxType = this.createOrGetFamixType(aliasNameWithGenerics, a);
|
|
120
121
|
fmxAlias.setAliasedEntity(fmxType);
|
|
121
122
|
this.famixFunctionsIndex.makeFamixIndexFileAnchor(a, fmxAlias);
|
|
@@ -195,7 +196,7 @@ class FamixFunctions {
|
|
|
195
196
|
propTypeName = property.getType().getText().trim();
|
|
196
197
|
}
|
|
197
198
|
catch (error) {
|
|
198
|
-
|
|
199
|
+
analyze_1.logger.error(`> WARNING: got exception ${error}. Failed to get usable name for property: ${property.getName()}. Continuing...`);
|
|
199
200
|
}
|
|
200
201
|
const fmxType = this.createOrGetFamixType(propTypeName, property);
|
|
201
202
|
fmxProperty.setDeclaredType(fmxType);
|
|
@@ -288,7 +289,7 @@ class FamixFunctions {
|
|
|
288
289
|
methodTypeName = method.getReturnType().getText().trim();
|
|
289
290
|
}
|
|
290
291
|
catch (error) {
|
|
291
|
-
|
|
292
|
+
analyze_1.logger.error(`> WARNING: got exception ${error}. Failed to get usable name for return type of method: ${fmxMethod.getName()}. Continuing...`);
|
|
292
293
|
}
|
|
293
294
|
const fmxType = this.createOrGetFamixType(methodTypeName, method);
|
|
294
295
|
fmxMethod.setDeclaredType(fmxType);
|
|
@@ -327,7 +328,7 @@ class FamixFunctions {
|
|
|
327
328
|
functionTypeName = func.getReturnType().getText().trim();
|
|
328
329
|
}
|
|
329
330
|
catch (error) {
|
|
330
|
-
|
|
331
|
+
analyze_1.logger.error(`> WARNING: got exception ${error}. Failed to get usable name for return type of function: ${func.getName()}. Continuing...`);
|
|
331
332
|
}
|
|
332
333
|
const fmxType = this.createOrGetFamixType(functionTypeName, func);
|
|
333
334
|
fmxFunction.setDeclaredType(fmxType);
|
|
@@ -350,7 +351,7 @@ class FamixFunctions {
|
|
|
350
351
|
paramTypeName = param.getType().getText().trim();
|
|
351
352
|
}
|
|
352
353
|
catch (error) {
|
|
353
|
-
|
|
354
|
+
analyze_1.logger.error(`> WARNING: got exception ${error}. Failed to get usable name for parameter: ${param.getName()}. Continuing...`);
|
|
354
355
|
}
|
|
355
356
|
const fmxType = this.createOrGetFamixType(paramTypeName, param);
|
|
356
357
|
fmxParam.setDeclaredType(fmxType);
|
|
@@ -363,11 +364,11 @@ class FamixFunctions {
|
|
|
363
364
|
* @param tp A type parameter
|
|
364
365
|
* @returns The Famix model of the type parameter
|
|
365
366
|
*/
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
this.famixFunctionsIndex.makeFamixIndexFileAnchor(tp,
|
|
370
|
-
return
|
|
367
|
+
createFamixParameterType(tp) {
|
|
368
|
+
const fmxParameterType = new Famix.ParameterType(this.famixRep);
|
|
369
|
+
fmxParameterType.setName(tp.getName());
|
|
370
|
+
this.famixFunctionsIndex.makeFamixIndexFileAnchor(tp, fmxParameterType);
|
|
371
|
+
return fmxParameterType;
|
|
371
372
|
}
|
|
372
373
|
/**
|
|
373
374
|
* Creates a Famix variable
|
|
@@ -381,7 +382,7 @@ class FamixFunctions {
|
|
|
381
382
|
variableTypeName = variable.getType().getText().trim();
|
|
382
383
|
}
|
|
383
384
|
catch (error) {
|
|
384
|
-
|
|
385
|
+
analyze_1.logger.error(`> WARNING: got exception ${error}. Failed to get usable name for variable: ${variable.getName()}. Continuing...`);
|
|
385
386
|
}
|
|
386
387
|
const fmxType = this.createOrGetFamixType(variableTypeName, variable);
|
|
387
388
|
fmxVariable.setDeclaredType(fmxType);
|
|
@@ -412,7 +413,7 @@ class FamixFunctions {
|
|
|
412
413
|
enumValueTypeName = enumMember.getType().getText().trim();
|
|
413
414
|
}
|
|
414
415
|
catch (error) {
|
|
415
|
-
|
|
416
|
+
analyze_1.logger.error(`> WARNING: got exception ${error}. Failed to get usable name for enum value: ${enumMember.getName()}. Continuing...`);
|
|
416
417
|
}
|
|
417
418
|
const fmxType = this.createOrGetFamixType(enumValueTypeName, enumMember);
|
|
418
419
|
fmxEnumValue.setDeclaredType(fmxType);
|
|
@@ -446,9 +447,9 @@ class FamixFunctions {
|
|
|
446
447
|
* @returns The Famix model of the comment
|
|
447
448
|
*/
|
|
448
449
|
createFamixComment(comment, fmxScope, isJSDoc) {
|
|
450
|
+
analyze_1.logger.debug(`> NOTE: creating comment ${comment.getText()} in scope ${fmxScope.getName()}.`);
|
|
449
451
|
const fmxComment = new Famix.Comment(this.famixRep);
|
|
450
|
-
fmxComment.
|
|
451
|
-
fmxComment.setContainer(fmxScope);
|
|
452
|
+
fmxComment.setContainer(fmxScope); // adds comment to the container's comments collection
|
|
452
453
|
fmxComment.setIsJSDoc(isJSDoc);
|
|
453
454
|
this.famixFunctionsIndex.makeFamixIndexFileAnchor(comment, fmxComment);
|
|
454
455
|
return fmxComment;
|
|
@@ -489,6 +490,8 @@ class FamixFunctions {
|
|
|
489
490
|
}
|
|
490
491
|
/**
|
|
491
492
|
* Creates a Famix import clause
|
|
493
|
+
* @param importClauseInfo An import clause
|
|
494
|
+
* @param importDeclaration An import declaration (optional)
|
|
492
495
|
* @param importer A source file which is a module
|
|
493
496
|
* @param moduleSpecifier The name of the module where the export declaration is
|
|
494
497
|
* @param moduleSpecifierFilePath The path of the module where the export declaration is
|
|
@@ -496,13 +499,8 @@ class FamixFunctions {
|
|
|
496
499
|
* @param isInExports A boolean indicating if the imported entity is in the exports
|
|
497
500
|
* @param isDefaultExport A boolean indicating if the imported entity is a default export
|
|
498
501
|
*/
|
|
499
|
-
createFamixImportClause(
|
|
500
|
-
this.famixFunctionsAssociations.createFamixImportClause(
|
|
501
|
-
}
|
|
502
|
-
// create the same function as createFamixImportClause but with a signature that has a single object parameter that has all the parameters
|
|
503
|
-
// this way we can call this function from the processImportClauses.ts file
|
|
504
|
-
createFamixImportClause2(importClause) {
|
|
505
|
-
this.famixFunctionsAssociations.createFamixImportClause(importClause.importer, importClause.moduleSpecifier, importClause.moduleSpecifierFilePath, importClause.importElement, importClause.isInExports, importClause.isDefaultExport);
|
|
502
|
+
createFamixImportClause(importClauseInfo) {
|
|
503
|
+
this.famixFunctionsAssociations.createFamixImportClause(importClauseInfo);
|
|
506
504
|
}
|
|
507
505
|
/**
|
|
508
506
|
* Gets a Famix entity by fully qualified name
|
|
@@ -28,7 +28,7 @@ const ts_morph_1 = require("ts-morph");
|
|
|
28
28
|
const Famix = __importStar(require("../lib/famix/src/model/famix"));
|
|
29
29
|
const fqn_1 = require("../fqn");
|
|
30
30
|
const famix_functions_index_1 = require("./famix_functions_index");
|
|
31
|
-
const
|
|
31
|
+
const analyze_1 = require("../analyze");
|
|
32
32
|
/**
|
|
33
33
|
* This class is used to build a Famix model for the associations
|
|
34
34
|
*/
|
|
@@ -90,7 +90,7 @@ class FamixFunctionsAssociations {
|
|
|
90
90
|
const fmxInheritance = new Famix.Inheritance(this.famixRep);
|
|
91
91
|
// const clsName = cls.getName();
|
|
92
92
|
const classFullyQualifiedName = this.FQNFunctions.getFQN(cls);
|
|
93
|
-
|
|
93
|
+
analyze_1.logger.debug(`createFamixInheritance: classFullyQualifiedName: class fqn = ${classFullyQualifiedName}`);
|
|
94
94
|
let subClass;
|
|
95
95
|
if (cls instanceof ts_morph_1.ClassDeclaration) {
|
|
96
96
|
subClass = this.famixClassMap.get(classFullyQualifiedName);
|
|
@@ -137,16 +137,18 @@ class FamixFunctionsAssociations {
|
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Creates a Famix import clause
|
|
140
|
+
* @param importClauseInfo The information needed to create a Famix import clause
|
|
141
|
+
* @param importDeclaration The import declaration
|
|
140
142
|
* @param importer A source file which is a module
|
|
141
|
-
* @param moduleSpecifier The name of the module where the export declaration is
|
|
142
143
|
* @param moduleSpecifierFilePath The path of the module where the export declaration is
|
|
143
144
|
* @param importElement The imported entity
|
|
144
145
|
* @param isInExports A boolean indicating if the imported entity is in the exports
|
|
145
146
|
* @param isDefaultExport A boolean indicating if the imported entity is a default export
|
|
146
147
|
*/
|
|
147
|
-
createFamixImportClause(
|
|
148
|
+
createFamixImportClause(importClauseInfo) {
|
|
148
149
|
var _a, _b;
|
|
149
|
-
|
|
150
|
+
const { importDeclaration, importer, moduleSpecifierFilePath, importElement, isInExports, isDefaultExport } = importClauseInfo;
|
|
151
|
+
analyze_1.logger.debug(`createFamixImportClause: Creating import clause:`);
|
|
150
152
|
const fmxImportClause = new Famix.ImportClause(this.famixRep);
|
|
151
153
|
let importedEntity;
|
|
152
154
|
let importedEntityName;
|
|
@@ -184,15 +186,10 @@ class FamixFunctionsAssociations {
|
|
|
184
186
|
const fmxImporter = this.getFamixEntityByFullyQualifiedName(importerFullyQualifiedName);
|
|
185
187
|
fmxImportClause.setImportingEntity(fmxImporter);
|
|
186
188
|
fmxImportClause.setImportedEntity(importedEntity);
|
|
187
|
-
fmxImportClause.setModuleSpecifier(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
fmxImportClause.getImportedEntity() instanceof famix_1.Enum ? 'Enum' :
|
|
192
|
-
fmxImportClause.getImportedEntity() instanceof famix_1.Alias ? 'Alias' :
|
|
193
|
-
fmxImportClause.getImportedEntity() instanceof famix_1.Variable ? 'Variable' :
|
|
194
|
-
'NamedEntity'}) is imported by ${(_b = fmxImportClause.getImportingEntity()) === null || _b === void 0 ? void 0 : _b.getName()}`);
|
|
195
|
-
this.famixFunctionsIndex.makeFamixIndexFileAnchor(null, fmxImportClause);
|
|
189
|
+
fmxImportClause.setModuleSpecifier(importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.getModuleSpecifierValue());
|
|
190
|
+
analyze_1.logger.debug(`createFamixImportClause: ${(_a = fmxImportClause.getImportedEntity()) === null || _a === void 0 ? void 0 : _a.getName()} (of type ${getSubTypeName(fmxImportClause.getImportedEntity())}) is imported by ${(_b = fmxImportClause.getImportingEntity()) === null || _b === void 0 ? void 0 : _b.getName()}`);
|
|
191
|
+
// make an index file anchor for the import clause
|
|
192
|
+
this.famixFunctionsIndex.makeFamixIndexFileAnchor(importDeclaration, fmxImportClause);
|
|
196
193
|
fmxImporter.addOutgoingImport(fmxImportClause);
|
|
197
194
|
}
|
|
198
195
|
/**
|
|
@@ -221,3 +218,21 @@ class FamixFunctionsAssociations {
|
|
|
221
218
|
}
|
|
222
219
|
}
|
|
223
220
|
exports.FamixFunctionsAssociations = FamixFunctionsAssociations;
|
|
221
|
+
function getSubTypeName(fmxNamedEntity) {
|
|
222
|
+
const name = fmxNamedEntity instanceof Famix.Class ? 'Class' :
|
|
223
|
+
fmxNamedEntity instanceof Famix.Interface ? 'Interface' :
|
|
224
|
+
fmxNamedEntity instanceof Famix.Function ? 'Function' :
|
|
225
|
+
fmxNamedEntity instanceof Famix.Enum ? 'Enum' :
|
|
226
|
+
fmxNamedEntity instanceof Famix.EnumValue ? 'EnumValue' :
|
|
227
|
+
fmxNamedEntity instanceof Famix.Alias ? 'Alias' :
|
|
228
|
+
fmxNamedEntity instanceof Famix.Variable ? 'Variable' :
|
|
229
|
+
fmxNamedEntity instanceof Famix.Type ? 'Type' :
|
|
230
|
+
fmxNamedEntity instanceof Famix.Method ? 'Method' :
|
|
231
|
+
fmxNamedEntity instanceof Famix.Decorator ? 'Decorator' :
|
|
232
|
+
fmxNamedEntity instanceof Famix.Accessor ? 'Accessor' :
|
|
233
|
+
fmxNamedEntity instanceof Famix.Parameter ? 'Parameter' :
|
|
234
|
+
fmxNamedEntity instanceof Famix.Property ? 'Property' :
|
|
235
|
+
'NamedEntity';
|
|
236
|
+
analyze_1.logger.debug(`${fmxNamedEntity.getName()} is of type ${name}`);
|
|
237
|
+
return name;
|
|
238
|
+
}
|
|
@@ -31,6 +31,7 @@ const ts_morph_1 = require("ts-morph");
|
|
|
31
31
|
const Famix = __importStar(require("../lib/famix/src/model/famix"));
|
|
32
32
|
const fqn_1 = require("../fqn");
|
|
33
33
|
const grapheme_splitter_1 = __importDefault(require("grapheme-splitter"));
|
|
34
|
+
const analyze_1 = require("../analyze");
|
|
34
35
|
/**
|
|
35
36
|
* This class is used to build a Famix model for the index file anchors
|
|
36
37
|
*/
|
|
@@ -49,12 +50,21 @@ class FamixFunctionsIndex {
|
|
|
49
50
|
* @param famixElement The Famix model of the source element
|
|
50
51
|
*/
|
|
51
52
|
makeFamixIndexFileAnchor(sourceElement, famixElement) {
|
|
53
|
+
analyze_1.logger.debug("making index file anchor for '" + (sourceElement === null || sourceElement === void 0 ? void 0 : sourceElement.getText()) + "' with famixElement " + famixElement.getJSON());
|
|
52
54
|
const fmxIndexFileAnchor = new Famix.IndexedFileAnchor(this.famixRep);
|
|
53
55
|
fmxIndexFileAnchor.setElement(famixElement);
|
|
54
56
|
if (sourceElement !== null) {
|
|
55
57
|
fmxIndexFileAnchor.setFileName(sourceElement.getSourceFile().getFilePath());
|
|
58
|
+
let sourceStart, sourceEnd;
|
|
56
59
|
if (!(sourceElement instanceof ts_morph_1.CommentRange)) {
|
|
57
|
-
|
|
60
|
+
sourceStart = sourceElement.getStart();
|
|
61
|
+
sourceEnd = sourceElement.getEnd();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
sourceStart = sourceElement.getPos();
|
|
65
|
+
sourceEnd = sourceElement.getEnd();
|
|
66
|
+
}
|
|
67
|
+
if (analyze_1.config.expectGraphemes) {
|
|
58
68
|
/**
|
|
59
69
|
* The following logic handles the case of multi-code point characters (e.g. emoji) in the source text.
|
|
60
70
|
* This is needed because Pharo/Smalltalk treats multi-code point characters as a single character,
|
|
@@ -69,30 +79,31 @@ class FamixFunctionsIndex {
|
|
|
69
79
|
const sourceFileText = sourceElement.getSourceFile().getFullText();
|
|
70
80
|
const hasGraphemeClusters = splitter.countGraphemes(sourceFileText) > 1;
|
|
71
81
|
if (hasGraphemeClusters) {
|
|
72
|
-
const sourceElementText = sourceFileText.substring(
|
|
82
|
+
const sourceElementText = sourceFileText.substring(sourceStart, sourceEnd);
|
|
73
83
|
const sourceElementTextGraphemes = splitter.splitGraphemes(sourceElementText);
|
|
74
84
|
const sourceFileTextGraphemes = splitter.splitGraphemes(sourceFileText);
|
|
75
|
-
const
|
|
76
|
-
const numberOfGraphemeClustersBeforeStart = splitter.countGraphemes(sourceFileText.substring(0, start));
|
|
85
|
+
const numberOfGraphemeClustersBeforeStart = splitter.countGraphemes(sourceFileText.substring(0, sourceStart));
|
|
77
86
|
// find the start of the sourceElementTextGraphemes array in the sourceFileTextGraphemes array
|
|
78
|
-
|
|
87
|
+
sourceStart = indexOfSplitArray({ searchArray: sourceFileTextGraphemes,
|
|
79
88
|
targetArray: sourceElementTextGraphemes,
|
|
80
|
-
start:
|
|
81
|
-
|
|
82
|
-
// note: the +1 is because the source anchor is 1-based, but ts-morph is 0-based
|
|
83
|
-
fmxIndexFileAnchor.setStartPos(newStart + 1);
|
|
84
|
-
fmxIndexFileAnchor.setEndPos(newEnd + 1);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// note: the +1 is because the source anchor is 1-based, but ts-morph is 0-based
|
|
88
|
-
fmxIndexFileAnchor.setStartPos(sourceElement.getStart() + 1);
|
|
89
|
-
fmxIndexFileAnchor.setEndPos(sourceElement.getEnd() + 1);
|
|
89
|
+
start: sourceStart - numberOfGraphemeClustersBeforeStart });
|
|
90
|
+
sourceEnd = sourceStart + sourceElementTextGraphemes.length;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
// note: the +1 is because the source anchor is 1-based, but ts-morph is 0-based
|
|
94
|
+
fmxIndexFileAnchor.setStartPos(sourceStart + 1);
|
|
95
|
+
fmxIndexFileAnchor.setEndPos(sourceEnd + 1);
|
|
92
96
|
if (!(famixElement instanceof Famix.Association) && !(famixElement instanceof Famix.Comment) && !(sourceElement instanceof ts_morph_1.CommentRange) && !(sourceElement instanceof ts_morph_1.Identifier) && !(sourceElement instanceof ts_morph_1.ImportSpecifier) && !(sourceElement instanceof ts_morph_1.ExpressionWithTypeArguments)) {
|
|
93
97
|
famixElement.setFullyQualifiedName(this.FQNFunctions.getFQN(sourceElement));
|
|
94
98
|
}
|
|
95
99
|
}
|
|
100
|
+
else {
|
|
101
|
+
// sourceElement is null
|
|
102
|
+
analyze_1.logger.warn("sourceElement is null for famixElement " + famixElement.getJSON());
|
|
103
|
+
fmxIndexFileAnchor.setFileName("unknown");
|
|
104
|
+
fmxIndexFileAnchor.setStartPos(0);
|
|
105
|
+
fmxIndexFileAnchor.setEndPos(0);
|
|
106
|
+
}
|
|
96
107
|
}
|
|
97
108
|
}
|
|
98
109
|
exports.FamixFunctionsIndex = FamixFunctionsIndex;
|
|
@@ -28,6 +28,7 @@ const ts_morph_1 = require("ts-morph");
|
|
|
28
28
|
const Famix = __importStar(require("../lib/famix/src/model/famix"));
|
|
29
29
|
const fqn_1 = require("../fqn");
|
|
30
30
|
const famix_functions_index_1 = require("./famix_functions_index");
|
|
31
|
+
const analyze_1 = require("../analyze");
|
|
31
32
|
/**
|
|
32
33
|
* This class is used to build a Famix model for the types
|
|
33
34
|
*/
|
|
@@ -52,7 +53,7 @@ class FamixFunctionsTypes {
|
|
|
52
53
|
let fmxType;
|
|
53
54
|
let isPrimitiveType = false;
|
|
54
55
|
let isParameterizedType = false;
|
|
55
|
-
|
|
56
|
+
analyze_1.logger.debug("Creating (or getting) type: '" + typeName + "' of element: " + element.getText() + " of kind: " + element.getKindName());
|
|
56
57
|
const typeAncestor = this.findTypeAncestor(element);
|
|
57
58
|
const ancestorFullyQualifiedName = this.FQNFunctions.getFQN(typeAncestor);
|
|
58
59
|
const ancestor = this.getFamixEntityByFullyQualifiedName(ancestorFullyQualifiedName);
|
|
@@ -16,6 +16,7 @@ class FamixRepository {
|
|
|
16
16
|
this.famixFunctions = new Set(); // All Famix functions
|
|
17
17
|
this.famixFiles = new Set(); // All Famix files
|
|
18
18
|
this.idCounter = 1; // Id counter
|
|
19
|
+
this.addElement(new famix_1.SourceLanguage(this)); // add the source language entity (TypeScript)
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Gets a Famix entity by id
|
|
@@ -36,6 +37,11 @@ class FamixRepository {
|
|
|
36
37
|
const entity = allEntities.find(e => e.getFullyQualifiedName() === fullyQualifiedName);
|
|
37
38
|
return entity;
|
|
38
39
|
}
|
|
40
|
+
export(arg0) {
|
|
41
|
+
if (arg0.format === "json") {
|
|
42
|
+
return this.getJSON();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
39
45
|
// Only for tests
|
|
40
46
|
/**
|
|
41
47
|
* Gets all Famix entities
|
|
@@ -25,9 +25,9 @@ class Access extends association_1.Association {
|
|
|
25
25
|
this.isWrite = isWrite;
|
|
26
26
|
}
|
|
27
27
|
getJSON() {
|
|
28
|
-
const
|
|
29
|
-
this.addPropertiesToExporter(
|
|
30
|
-
return
|
|
28
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Access", this);
|
|
29
|
+
this.addPropertiesToExporter(json);
|
|
30
|
+
return json.getJSON();
|
|
31
31
|
}
|
|
32
32
|
addPropertiesToExporter(exporter) {
|
|
33
33
|
super.addPropertiesToExporter(exporter);
|
|
@@ -5,9 +5,9 @@ const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
|
|
|
5
5
|
const method_1 = require("./method");
|
|
6
6
|
class Accessor extends method_1.Method {
|
|
7
7
|
getJSON() {
|
|
8
|
-
const
|
|
9
|
-
this.addPropertiesToExporter(
|
|
10
|
-
return
|
|
8
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Accessor", this);
|
|
9
|
+
this.addPropertiesToExporter(json);
|
|
10
|
+
return json.getJSON();
|
|
11
11
|
}
|
|
12
12
|
addPropertiesToExporter(exporter) {
|
|
13
13
|
super.addPropertiesToExporter(exporter);
|
|
@@ -19,9 +19,9 @@ class Alias extends named_entity_1.NamedEntity {
|
|
|
19
19
|
aliasedEntity.addTypeAlias(this);
|
|
20
20
|
}
|
|
21
21
|
getJSON() {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Alias", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
addPropertiesToExporter(exporter) {
|
|
27
27
|
super.addPropertiesToExporter(exporter);
|
|
@@ -23,9 +23,9 @@ class Association extends sourced_entity_1.SourcedEntity {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
getJSON() {
|
|
26
|
-
const
|
|
27
|
-
this.addPropertiesToExporter(
|
|
28
|
-
return
|
|
26
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Association", this);
|
|
27
|
+
this.addPropertiesToExporter(json);
|
|
28
|
+
return json.getJSON();
|
|
29
29
|
}
|
|
30
30
|
addPropertiesToExporter(exporter) {
|
|
31
31
|
super.addPropertiesToExporter(exporter);
|
|
@@ -53,19 +53,19 @@ class BehavioralEntity extends container_entity_1.ContainerEntity {
|
|
|
53
53
|
this.declaredType = declaredType;
|
|
54
54
|
declaredType.addBehavioralEntityWithDeclaredType(this);
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
getParameterTypes() {
|
|
57
57
|
return this.typeParameters;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
addParameterType(typeParameter) {
|
|
60
60
|
if (!this.typeParameters.has(typeParameter)) {
|
|
61
61
|
this.typeParameters.add(typeParameter);
|
|
62
62
|
typeParameter.setParentGeneric(this);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
getJSON() {
|
|
66
|
-
const
|
|
67
|
-
this.addPropertiesToExporter(
|
|
68
|
-
return
|
|
66
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("BehavioralEntity", this);
|
|
67
|
+
this.addPropertiesToExporter(json);
|
|
68
|
+
return json.getJSON();
|
|
69
69
|
}
|
|
70
70
|
addPropertiesToExporter(exporter) {
|
|
71
71
|
super.addPropertiesToExporter(exporter);
|
|
@@ -75,7 +75,7 @@ class BehavioralEntity extends container_entity_1.ContainerEntity {
|
|
|
75
75
|
exporter.addProperty("numberOfParameters", this.getNumberOfParameters());
|
|
76
76
|
exporter.addProperty("incomingInvocations", this.getIncomingInvocations());
|
|
77
77
|
exporter.addProperty("declaredType", this.getDeclaredType());
|
|
78
|
-
exporter.addProperty("typeParameters", this.
|
|
78
|
+
exporter.addProperty("typeParameters", this.getParameterTypes());
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
exports.BehavioralEntity = BehavioralEntity;
|
|
@@ -54,9 +54,9 @@ class Class extends type_1.Type {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
getJSON() {
|
|
57
|
-
const
|
|
58
|
-
this.addPropertiesToExporter(
|
|
59
|
-
return
|
|
57
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Class", this);
|
|
58
|
+
this.addPropertiesToExporter(json);
|
|
59
|
+
return json.getJSON();
|
|
60
60
|
}
|
|
61
61
|
addPropertiesToExporter(exporter) {
|
|
62
62
|
super.addPropertiesToExporter(exporter);
|
|
@@ -24,9 +24,9 @@ class Comment extends sourced_entity_1.SourcedEntity {
|
|
|
24
24
|
this.content = content;
|
|
25
25
|
}
|
|
26
26
|
getJSON() {
|
|
27
|
-
const
|
|
28
|
-
this.addPropertiesToExporter(
|
|
29
|
-
return
|
|
27
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Comment", this);
|
|
28
|
+
this.addPropertiesToExporter(json);
|
|
29
|
+
return json.getJSON();
|
|
30
30
|
}
|
|
31
31
|
addPropertiesToExporter(exporter) {
|
|
32
32
|
super.addPropertiesToExporter(exporter);
|
|
@@ -103,9 +103,9 @@ class ContainerEntity extends named_entity_1.NamedEntity {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
getJSON() {
|
|
106
|
-
const
|
|
107
|
-
this.addPropertiesToExporter(
|
|
108
|
-
return
|
|
106
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("ContainerEntity", this);
|
|
107
|
+
this.addPropertiesToExporter(json);
|
|
108
|
+
return json.getJSON();
|
|
109
109
|
}
|
|
110
110
|
addPropertiesToExporter(exporter) {
|
|
111
111
|
super.addPropertiesToExporter(exporter);
|
|
@@ -18,9 +18,9 @@ class Decorator extends named_entity_1.NamedEntity {
|
|
|
18
18
|
decoratedEntity.addDecorator(this);
|
|
19
19
|
}
|
|
20
20
|
getJSON() {
|
|
21
|
-
const
|
|
22
|
-
this.addPropertiesToExporter(
|
|
23
|
-
return
|
|
21
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Decorator", this);
|
|
22
|
+
this.addPropertiesToExporter(json);
|
|
23
|
+
return json.getJSON();
|
|
24
24
|
}
|
|
25
25
|
addPropertiesToExporter(exporter) {
|
|
26
26
|
super.addPropertiesToExporter(exporter);
|
|
@@ -5,9 +5,9 @@ const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
|
|
|
5
5
|
const famix_base_element_1 = require("../../famix_base_element");
|
|
6
6
|
class Entity extends famix_base_element_1.FamixBaseElement {
|
|
7
7
|
getJSON() {
|
|
8
|
-
const
|
|
9
|
-
this.addPropertiesToExporter(
|
|
10
|
-
return
|
|
8
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Entity", this);
|
|
9
|
+
this.addPropertiesToExporter(json);
|
|
10
|
+
return json.getJSON();
|
|
11
11
|
}
|
|
12
12
|
addPropertiesToExporter(exporter) {
|
|
13
13
|
super.addPropertiesToExporter(exporter);
|
|
@@ -18,9 +18,9 @@ class Enum extends type_1.Type {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
getJSON() {
|
|
21
|
-
const
|
|
22
|
-
this.addPropertiesToExporter(
|
|
23
|
-
return
|
|
21
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Enum", this);
|
|
22
|
+
this.addPropertiesToExporter(json);
|
|
23
|
+
return json.getJSON();
|
|
24
24
|
}
|
|
25
25
|
addPropertiesToExporter(exporter) {
|
|
26
26
|
super.addPropertiesToExporter(exporter);
|
|
@@ -12,9 +12,9 @@ class EnumValue extends structural_entity_1.StructuralEntity {
|
|
|
12
12
|
parentEntity.addValue(this);
|
|
13
13
|
}
|
|
14
14
|
getJSON() {
|
|
15
|
-
const
|
|
16
|
-
this.addPropertiesToExporter(
|
|
17
|
-
return
|
|
15
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("EnumValue", this);
|
|
16
|
+
this.addPropertiesToExporter(json);
|
|
17
|
+
return json.getJSON();
|
|
18
18
|
}
|
|
19
19
|
addPropertiesToExporter(exporter) {
|
|
20
20
|
super.addPropertiesToExporter(exporter);
|
|
@@ -5,9 +5,9 @@ const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
|
|
|
5
5
|
const behavioral_entity_1 = require("./behavioral_entity");
|
|
6
6
|
class Function extends behavioral_entity_1.BehavioralEntity {
|
|
7
7
|
getJSON() {
|
|
8
|
-
const
|
|
9
|
-
this.addPropertiesToExporter(
|
|
10
|
-
return
|
|
8
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Function", this);
|
|
9
|
+
this.addPropertiesToExporter(json);
|
|
10
|
+
return json.getJSON();
|
|
11
11
|
}
|
|
12
12
|
addPropertiesToExporter(exporter) {
|
|
13
13
|
super.addPropertiesToExporter(exporter);
|
|
@@ -5,9 +5,9 @@ const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
|
|
|
5
5
|
const variable_1 = require("./variable");
|
|
6
6
|
class ImplicitVariable extends variable_1.Variable {
|
|
7
7
|
getJSON() {
|
|
8
|
-
const
|
|
9
|
-
this.addPropertiesToExporter(
|
|
10
|
-
return
|
|
8
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("ImplicitVariable", this);
|
|
9
|
+
this.addPropertiesToExporter(json);
|
|
10
|
+
return json.getJSON();
|
|
11
11
|
}
|
|
12
12
|
addPropertiesToExporter(exporter) {
|
|
13
13
|
super.addPropertiesToExporter(exporter);
|
|
@@ -25,9 +25,9 @@ class ImportClause extends association_1.Association {
|
|
|
25
25
|
this.moduleSpecifier = moduleSpecifier;
|
|
26
26
|
}
|
|
27
27
|
getJSON() {
|
|
28
|
-
const
|
|
29
|
-
this.addPropertiesToExporter(
|
|
30
|
-
return
|
|
28
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("ImportClause", this);
|
|
29
|
+
this.addPropertiesToExporter(json);
|
|
30
|
+
return json.getJSON();
|
|
31
31
|
}
|
|
32
32
|
addPropertiesToExporter(exporter) {
|
|
33
33
|
super.addPropertiesToExporter(exporter);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Variable = exports.Type = exports.TextAnchor = exports.StructuralEntity = exports.SourcedEntity = exports.SourceLanguage = exports.SourceAnchor = exports.ScriptEntity = exports.ScopingEntity = exports.Reference = exports.PrimitiveType = exports.ParameterizedType = exports.ParameterizableInterface = exports.ParameterizableClass = exports.Parameter = exports.
|
|
3
|
+
exports.Variable = exports.Type = exports.TextAnchor = exports.StructuralEntity = exports.SourcedEntity = exports.SourceLanguage = exports.SourceAnchor = exports.ScriptEntity = exports.ScopingEntity = exports.Reference = exports.PrimitiveType = exports.ParameterizedType = exports.ParameterizableInterface = exports.ParameterizableClass = exports.Parameter = exports.ParameterType = exports.Namespace = exports.NamedEntity = exports.Module = exports.Method = exports.Invocation = exports.Interface = exports.Inheritance = exports.IndexedFileAnchor = exports.ImportClause = exports.ImplicitVariable = exports.Function = exports.Property = exports.Enum = exports.EnumValue = exports.Entity = exports.Decorator = exports.ContainerEntity = exports.Comment = exports.Class = exports.BehavioralEntity = exports.Association = exports.Alias = exports.Accessor = exports.Access = void 0;
|
|
4
4
|
var access_1 = require("./access");
|
|
5
5
|
Object.defineProperty(exports, "Access", { enumerable: true, get: function () { return access_1.Access; } });
|
|
6
6
|
var accessor_1 = require("./accessor");
|
|
@@ -11,16 +11,12 @@ var association_1 = require("./association");
|
|
|
11
11
|
Object.defineProperty(exports, "Association", { enumerable: true, get: function () { return association_1.Association; } });
|
|
12
12
|
var behavioral_entity_1 = require("./behavioral_entity");
|
|
13
13
|
Object.defineProperty(exports, "BehavioralEntity", { enumerable: true, get: function () { return behavioral_entity_1.BehavioralEntity; } });
|
|
14
|
-
var c_source_language_1 = require("./c_source_language");
|
|
15
|
-
Object.defineProperty(exports, "CSourceLanguage", { enumerable: true, get: function () { return c_source_language_1.CSourceLanguage; } });
|
|
16
14
|
var class_1 = require("./class");
|
|
17
15
|
Object.defineProperty(exports, "Class", { enumerable: true, get: function () { return class_1.Class; } });
|
|
18
16
|
var comment_1 = require("./comment");
|
|
19
17
|
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return comment_1.Comment; } });
|
|
20
18
|
var container_entity_1 = require("./container_entity");
|
|
21
19
|
Object.defineProperty(exports, "ContainerEntity", { enumerable: true, get: function () { return container_entity_1.ContainerEntity; } });
|
|
22
|
-
var custom_source_language_1 = require("./custom_source_language");
|
|
23
|
-
Object.defineProperty(exports, "CustomSourceLanguage", { enumerable: true, get: function () { return custom_source_language_1.CustomSourceLanguage; } });
|
|
24
20
|
var decorator_1 = require("./decorator");
|
|
25
21
|
Object.defineProperty(exports, "Decorator", { enumerable: true, get: function () { return decorator_1.Decorator; } });
|
|
26
22
|
var entity_1 = require("./entity");
|
|
@@ -53,8 +49,8 @@ var named_entity_1 = require("./named_entity");
|
|
|
53
49
|
Object.defineProperty(exports, "NamedEntity", { enumerable: true, get: function () { return named_entity_1.NamedEntity; } });
|
|
54
50
|
var namespace_1 = require("./namespace");
|
|
55
51
|
Object.defineProperty(exports, "Namespace", { enumerable: true, get: function () { return namespace_1.Namespace; } });
|
|
56
|
-
var
|
|
57
|
-
Object.defineProperty(exports, "
|
|
52
|
+
var parameter_type_1 = require("./parameter_type");
|
|
53
|
+
Object.defineProperty(exports, "ParameterType", { enumerable: true, get: function () { return parameter_type_1.ParameterType; } });
|
|
58
54
|
var parameter_1 = require("./parameter");
|
|
59
55
|
Object.defineProperty(exports, "Parameter", { enumerable: true, get: function () { return parameter_1.Parameter; } });
|
|
60
56
|
var parameterizable_class_1 = require("./parameterizable_class");
|
|
@@ -23,9 +23,9 @@ class IndexedFileAnchor extends source_anchor_1.SourceAnchor {
|
|
|
23
23
|
this.fileName = fileName;
|
|
24
24
|
}
|
|
25
25
|
getJSON() {
|
|
26
|
-
const
|
|
27
|
-
this.addPropertiesToExporter(
|
|
28
|
-
return
|
|
26
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("IndexedFileAnchor", this);
|
|
27
|
+
this.addPropertiesToExporter(json);
|
|
28
|
+
return json.getJSON();
|
|
29
29
|
}
|
|
30
30
|
addPropertiesToExporter(exporter) {
|
|
31
31
|
super.addPropertiesToExporter(exporter);
|
|
@@ -19,9 +19,9 @@ class Inheritance extends association_1.Association {
|
|
|
19
19
|
subclass.addSuperInheritance(this);
|
|
20
20
|
}
|
|
21
21
|
getJSON() {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json = new famix_JSON_exporter_1.FamixJSONExporter("Inheritance", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
addPropertiesToExporter(exporter) {
|
|
27
27
|
super.addPropertiesToExporter(exporter);
|