ts2famix 1.1.0 → 1.3.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 +5 -5
- 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 +32 -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 +17 -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 +34 -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 +25 -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
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ClassDeclaration, ConstructorDeclaration, FunctionDeclaration, Identifier, InterfaceDeclaration, MethodDeclaration, MethodSignature, ModuleDeclaration, PropertyDeclaration, PropertySignature, SourceFile, TypeParameterDeclaration, VariableDeclaration, ParameterDeclaration, Decorator, GetAccessorDeclaration, SetAccessorDeclaration, ImportSpecifier, CommentRange, EnumDeclaration, EnumMember, TypeAliasDeclaration, FunctionExpression, ExpressionWithTypeArguments } from "ts-morph";
|
|
1
|
+
import { ClassDeclaration, ConstructorDeclaration, FunctionDeclaration, Identifier, InterfaceDeclaration, MethodDeclaration, MethodSignature, ModuleDeclaration, PropertyDeclaration, PropertySignature, SourceFile, TypeParameterDeclaration, VariableDeclaration, ParameterDeclaration, Decorator, GetAccessorDeclaration, SetAccessorDeclaration, ImportSpecifier, CommentRange, EnumDeclaration, EnumMember, TypeAliasDeclaration, FunctionExpression, ExpressionWithTypeArguments, ImportDeclaration } from "ts-morph";
|
|
2
2
|
import * as Famix from "../lib/famix/src/model/famix";
|
|
3
3
|
import { FamixRepository } from "../lib/famix/src/famix_repository";
|
|
4
4
|
import { FQNFunctions } from "../fqn";
|
|
5
5
|
import { FamixFunctionsIndex } from "./famix_functions_index";
|
|
6
6
|
import { FamixFunctionsAssociations } from "./famix_functions_associations";
|
|
7
7
|
import { FamixFunctionsTypes } from "./famix_functions_types";
|
|
8
|
+
import { logger } from "../analyze";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* This class contains all the functions needed to create Famix entities
|
|
@@ -97,7 +98,7 @@ export class FamixFunctions {
|
|
|
97
98
|
fmxAlias = new Famix.Alias(this.famixRep);
|
|
98
99
|
fmxAlias.setName(a.getName());
|
|
99
100
|
const aliasNameWithGenerics = aliasName + (a.getTypeParameters().length ? ("<" + a.getTypeParameters().map(tp => tp.getName()).join(", ") + ">") : "");
|
|
100
|
-
|
|
101
|
+
logger.debug(`> NOTE: alias ${aliasName} has fully qualified name ${aliasFullyQualifiedName} and name with generics ${aliasNameWithGenerics}.`);
|
|
101
102
|
|
|
102
103
|
const fmxType = this.createOrGetFamixType(aliasNameWithGenerics, a);
|
|
103
104
|
fmxAlias.setAliasedEntity(fmxType);
|
|
@@ -189,7 +190,7 @@ export class FamixFunctions {
|
|
|
189
190
|
try {
|
|
190
191
|
propTypeName = property.getType().getText().trim();
|
|
191
192
|
} catch (error) {
|
|
192
|
-
|
|
193
|
+
logger.error(`> WARNING: got exception ${error}. Failed to get usable name for property: ${property.getName()}. Continuing...`);
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
const fmxType = this.createOrGetFamixType(propTypeName, property);
|
|
@@ -288,7 +289,7 @@ export class FamixFunctions {
|
|
|
288
289
|
try {
|
|
289
290
|
methodTypeName = method.getReturnType().getText().trim();
|
|
290
291
|
} catch (error) {
|
|
291
|
-
|
|
292
|
+
logger.error(`> WARNING: got exception ${error}. Failed to get usable name for return type of method: ${fmxMethod.getName()}. Continuing...`);
|
|
292
293
|
}
|
|
293
294
|
|
|
294
295
|
const fmxType = this.createOrGetFamixType(methodTypeName, method);
|
|
@@ -332,7 +333,7 @@ export class FamixFunctions {
|
|
|
332
333
|
try {
|
|
333
334
|
functionTypeName = func.getReturnType().getText().trim();
|
|
334
335
|
} catch (error) {
|
|
335
|
-
|
|
336
|
+
logger.error(`> WARNING: got exception ${error}. Failed to get usable name for return type of function: ${func.getName()}. Continuing...`);
|
|
336
337
|
}
|
|
337
338
|
|
|
338
339
|
const fmxType = this.createOrGetFamixType(functionTypeName, func);
|
|
@@ -359,7 +360,7 @@ export class FamixFunctions {
|
|
|
359
360
|
try {
|
|
360
361
|
paramTypeName = param.getType().getText().trim();
|
|
361
362
|
} catch (error) {
|
|
362
|
-
|
|
363
|
+
logger.error(`> WARNING: got exception ${error}. Failed to get usable name for parameter: ${param.getName()}. Continuing...`);
|
|
363
364
|
}
|
|
364
365
|
|
|
365
366
|
const fmxType = this.createOrGetFamixType(paramTypeName, param);
|
|
@@ -376,13 +377,13 @@ export class FamixFunctions {
|
|
|
376
377
|
* @param tp A type parameter
|
|
377
378
|
* @returns The Famix model of the type parameter
|
|
378
379
|
*/
|
|
379
|
-
public
|
|
380
|
-
const
|
|
381
|
-
|
|
380
|
+
public createFamixParameterType(tp: TypeParameterDeclaration): Famix.ParameterType {
|
|
381
|
+
const fmxParameterType = new Famix.ParameterType(this.famixRep);
|
|
382
|
+
fmxParameterType.setName(tp.getName());
|
|
382
383
|
|
|
383
|
-
this.famixFunctionsIndex.makeFamixIndexFileAnchor(tp,
|
|
384
|
+
this.famixFunctionsIndex.makeFamixIndexFileAnchor(tp, fmxParameterType);
|
|
384
385
|
|
|
385
|
-
return
|
|
386
|
+
return fmxParameterType;
|
|
386
387
|
}
|
|
387
388
|
|
|
388
389
|
/**
|
|
@@ -397,7 +398,7 @@ export class FamixFunctions {
|
|
|
397
398
|
try {
|
|
398
399
|
variableTypeName = variable.getType().getText().trim();
|
|
399
400
|
} catch (error) {
|
|
400
|
-
|
|
401
|
+
logger.error(`> WARNING: got exception ${error}. Failed to get usable name for variable: ${variable.getName()}. Continuing...`);
|
|
401
402
|
}
|
|
402
403
|
|
|
403
404
|
const fmxType = this.createOrGetFamixType(variableTypeName, variable);
|
|
@@ -435,7 +436,7 @@ export class FamixFunctions {
|
|
|
435
436
|
try {
|
|
436
437
|
enumValueTypeName = enumMember.getType().getText().trim();
|
|
437
438
|
} catch (error) {
|
|
438
|
-
|
|
439
|
+
logger.error(`> WARNING: got exception ${error}. Failed to get usable name for enum value: ${enumMember.getName()}. Continuing...`);
|
|
439
440
|
}
|
|
440
441
|
|
|
441
442
|
const fmxType = this.createOrGetFamixType(enumValueTypeName, enumMember);
|
|
@@ -477,9 +478,9 @@ export class FamixFunctions {
|
|
|
477
478
|
* @returns The Famix model of the comment
|
|
478
479
|
*/
|
|
479
480
|
public createFamixComment(comment: CommentRange, fmxScope: Famix.NamedEntity, isJSDoc: boolean): Famix.Comment {
|
|
481
|
+
logger.debug(`> NOTE: creating comment ${comment.getText()} in scope ${fmxScope.getName()}.`);
|
|
480
482
|
const fmxComment = new Famix.Comment(this.famixRep);
|
|
481
|
-
fmxComment.
|
|
482
|
-
fmxComment.setContainer(fmxScope);
|
|
483
|
+
fmxComment.setContainer(fmxScope); // adds comment to the container's comments collection
|
|
483
484
|
fmxComment.setIsJSDoc(isJSDoc);
|
|
484
485
|
|
|
485
486
|
this.famixFunctionsIndex.makeFamixIndexFileAnchor(comment, fmxComment);
|
|
@@ -527,6 +528,8 @@ export class FamixFunctions {
|
|
|
527
528
|
|
|
528
529
|
/**
|
|
529
530
|
* Creates a Famix import clause
|
|
531
|
+
* @param importClauseInfo An import clause
|
|
532
|
+
* @param importDeclaration An import declaration (optional)
|
|
530
533
|
* @param importer A source file which is a module
|
|
531
534
|
* @param moduleSpecifier The name of the module where the export declaration is
|
|
532
535
|
* @param moduleSpecifierFilePath The path of the module where the export declaration is
|
|
@@ -534,14 +537,8 @@ export class FamixFunctions {
|
|
|
534
537
|
* @param isInExports A boolean indicating if the imported entity is in the exports
|
|
535
538
|
* @param isDefaultExport A boolean indicating if the imported entity is a default export
|
|
536
539
|
*/
|
|
537
|
-
public createFamixImportClause(
|
|
538
|
-
this.famixFunctionsAssociations.createFamixImportClause(
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// create the same function as createFamixImportClause but with a signature that has a single object parameter that has all the parameters
|
|
542
|
-
// this way we can call this function from the processImportClauses.ts file
|
|
543
|
-
public createFamixImportClause2(importClause: {importer: SourceFile, moduleSpecifier: string, moduleSpecifierFilePath: string, importElement: ImportSpecifier | Identifier, isInExports: boolean, isDefaultExport: boolean}): void {
|
|
544
|
-
this.famixFunctionsAssociations.createFamixImportClause(importClause.importer, importClause.moduleSpecifier, importClause.moduleSpecifierFilePath, importClause.importElement, importClause.isInExports, importClause.isDefaultExport);
|
|
540
|
+
public createFamixImportClause(importClauseInfo: {importDeclaration?: ImportDeclaration, importer: SourceFile, moduleSpecifierFilePath: string, importElement: ImportSpecifier | Identifier, isInExports: boolean, isDefaultExport: boolean}): void {
|
|
541
|
+
this.famixFunctionsAssociations.createFamixImportClause(importClauseInfo);
|
|
545
542
|
}
|
|
546
543
|
|
|
547
544
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ClassDeclaration, ConstructorDeclaration, FunctionDeclaration, Identifier, InterfaceDeclaration, MethodDeclaration, SourceFile, GetAccessorDeclaration, SetAccessorDeclaration, Node, ImportSpecifier, SyntaxKind, FunctionExpression, ExpressionWithTypeArguments } from "ts-morph";
|
|
1
|
+
import { ClassDeclaration, ConstructorDeclaration, FunctionDeclaration, Identifier, InterfaceDeclaration, MethodDeclaration, SourceFile, GetAccessorDeclaration, SetAccessorDeclaration, Node, ImportSpecifier, SyntaxKind, FunctionExpression, ExpressionWithTypeArguments, ImportDeclaration } from "ts-morph";
|
|
2
2
|
import * as Famix from "../lib/famix/src/model/famix";
|
|
3
3
|
import { FamixRepository } from "../lib/famix/src/famix_repository";
|
|
4
4
|
import { FQNFunctions } from "../fqn";
|
|
5
5
|
import { FamixFunctionsIndex } from "./famix_functions_index";
|
|
6
|
-
import {
|
|
6
|
+
import { logger } from "../analyze";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* This class is used to build a Famix model for the associations
|
|
@@ -79,7 +79,7 @@ export class FamixFunctionsAssociations {
|
|
|
79
79
|
const fmxInheritance = new Famix.Inheritance(this.famixRep);
|
|
80
80
|
// const clsName = cls.getName();
|
|
81
81
|
const classFullyQualifiedName = this.FQNFunctions.getFQN(cls);
|
|
82
|
-
|
|
82
|
+
logger.debug(`createFamixInheritance: classFullyQualifiedName: class fqn = ${classFullyQualifiedName}`);
|
|
83
83
|
let subClass: Famix.Class | Famix.Interface;
|
|
84
84
|
if (cls instanceof ClassDeclaration) {
|
|
85
85
|
subClass = this.famixClassMap.get(classFullyQualifiedName);
|
|
@@ -133,15 +133,17 @@ export class FamixFunctionsAssociations {
|
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* Creates a Famix import clause
|
|
136
|
+
* @param importClauseInfo The information needed to create a Famix import clause
|
|
137
|
+
* @param importDeclaration The import declaration
|
|
136
138
|
* @param importer A source file which is a module
|
|
137
|
-
* @param moduleSpecifier The name of the module where the export declaration is
|
|
138
139
|
* @param moduleSpecifierFilePath The path of the module where the export declaration is
|
|
139
140
|
* @param importElement The imported entity
|
|
140
141
|
* @param isInExports A boolean indicating if the imported entity is in the exports
|
|
141
142
|
* @param isDefaultExport A boolean indicating if the imported entity is a default export
|
|
142
143
|
*/
|
|
143
|
-
public createFamixImportClause(
|
|
144
|
-
|
|
144
|
+
public createFamixImportClause(importClauseInfo: {importDeclaration?: ImportDeclaration, importer: SourceFile, moduleSpecifierFilePath: string, importElement: ImportSpecifier | Identifier, isInExports: boolean, isDefaultExport: boolean}): void {
|
|
145
|
+
const {importDeclaration, importer, moduleSpecifierFilePath, importElement, isInExports, isDefaultExport} = importClauseInfo;
|
|
146
|
+
logger.debug(`createFamixImportClause: Creating import clause:`);
|
|
145
147
|
const fmxImportClause = new Famix.ImportClause(this.famixRep);
|
|
146
148
|
|
|
147
149
|
let importedEntity: Famix.NamedEntity;
|
|
@@ -181,17 +183,13 @@ export class FamixFunctionsAssociations {
|
|
|
181
183
|
const fmxImporter = this.getFamixEntityByFullyQualifiedName(importerFullyQualifiedName) as Famix.Module;
|
|
182
184
|
fmxImportClause.setImportingEntity(fmxImporter);
|
|
183
185
|
fmxImportClause.setImportedEntity(importedEntity);
|
|
184
|
-
fmxImportClause.setModuleSpecifier(
|
|
186
|
+
fmxImportClause.setModuleSpecifier(importDeclaration?.getModuleSpecifierValue() as string);
|
|
185
187
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
fmxImportClause.getImportedEntity() instanceof Function ? 'Function' :
|
|
189
|
-
fmxImportClause.getImportedEntity() instanceof Enum ? 'Enum' :
|
|
190
|
-
fmxImportClause.getImportedEntity() instanceof Alias ? 'Alias' :
|
|
191
|
-
fmxImportClause.getImportedEntity() instanceof Variable ? 'Variable' :
|
|
192
|
-
'NamedEntity'}) is imported by ${fmxImportClause.getImportingEntity()?.getName()}`);
|
|
188
|
+
logger.debug(`createFamixImportClause: ${fmxImportClause.getImportedEntity()?.getName()} (of type ${
|
|
189
|
+
getSubTypeName(fmxImportClause.getImportedEntity())}) is imported by ${fmxImportClause.getImportingEntity()?.getName()}`);
|
|
193
190
|
|
|
194
|
-
|
|
191
|
+
// make an index file anchor for the import clause
|
|
192
|
+
this.famixFunctionsIndex.makeFamixIndexFileAnchor(importDeclaration, fmxImportClause);
|
|
195
193
|
|
|
196
194
|
fmxImporter.addOutgoingImport(fmxImportClause);
|
|
197
195
|
}
|
|
@@ -223,3 +221,22 @@ export class FamixFunctionsAssociations {
|
|
|
223
221
|
return node.getAncestors().find(a => a.getKind() === SyntaxKind.MethodDeclaration || a.getKind() === SyntaxKind.Constructor || a.getKind() === SyntaxKind.FunctionDeclaration || a.getKind() === SyntaxKind.FunctionExpression || a.getKind() === SyntaxKind.ModuleDeclaration || a.getKind() === SyntaxKind.SourceFile || a.getKindName() === "GetAccessor" || a.getKindName() === "SetAccessor" || a.getKind() === SyntaxKind.ClassDeclaration);
|
|
224
222
|
}
|
|
225
223
|
}
|
|
224
|
+
function getSubTypeName(fmxNamedEntity: Famix.NamedEntity) {
|
|
225
|
+
const name = fmxNamedEntity instanceof Famix.Class ? 'Class' :
|
|
226
|
+
fmxNamedEntity instanceof Famix.Interface ? 'Interface' :
|
|
227
|
+
fmxNamedEntity instanceof Famix.Function ? 'Function' :
|
|
228
|
+
fmxNamedEntity instanceof Famix.Enum ? 'Enum' :
|
|
229
|
+
fmxNamedEntity instanceof Famix.EnumValue ? 'EnumValue' :
|
|
230
|
+
fmxNamedEntity instanceof Famix.Alias ? 'Alias' :
|
|
231
|
+
fmxNamedEntity instanceof Famix.Variable ? 'Variable' :
|
|
232
|
+
fmxNamedEntity instanceof Famix.Type ? 'Type' :
|
|
233
|
+
fmxNamedEntity instanceof Famix.Method ? 'Method' :
|
|
234
|
+
fmxNamedEntity instanceof Famix.Decorator ? 'Decorator' :
|
|
235
|
+
fmxNamedEntity instanceof Famix.Accessor ? 'Accessor' :
|
|
236
|
+
fmxNamedEntity instanceof Famix.Parameter ? 'Parameter' :
|
|
237
|
+
fmxNamedEntity instanceof Famix.Property ? 'Property' :
|
|
238
|
+
'NamedEntity';
|
|
239
|
+
logger.debug(`${fmxNamedEntity.getName()} is of type ${name}`);
|
|
240
|
+
return name;
|
|
241
|
+
}
|
|
242
|
+
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ClassDeclaration, ConstructorDeclaration, FunctionDeclaration, Identifier, InterfaceDeclaration, MethodDeclaration, MethodSignature, ModuleDeclaration, PropertyDeclaration, PropertySignature, SourceFile, TypeParameterDeclaration, VariableDeclaration, ParameterDeclaration, Decorator, GetAccessorDeclaration, SetAccessorDeclaration, ImportSpecifier, CommentRange, EnumDeclaration, EnumMember, TypeAliasDeclaration, FunctionExpression, ExpressionWithTypeArguments } from "ts-morph";
|
|
1
|
+
import { ClassDeclaration, ConstructorDeclaration, FunctionDeclaration, Identifier, InterfaceDeclaration, MethodDeclaration, MethodSignature, ModuleDeclaration, PropertyDeclaration, PropertySignature, SourceFile, TypeParameterDeclaration, VariableDeclaration, ParameterDeclaration, Decorator, GetAccessorDeclaration, SetAccessorDeclaration, ImportSpecifier, CommentRange, EnumDeclaration, EnumMember, TypeAliasDeclaration, FunctionExpression, ExpressionWithTypeArguments, ImportDeclaration } from "ts-morph";
|
|
2
2
|
import * as Famix from "../lib/famix/src/model/famix";
|
|
3
3
|
import { FamixRepository } from "../lib/famix/src/famix_repository";
|
|
4
4
|
import { FQNFunctions } from "../fqn";
|
|
5
5
|
import GraphemeSplitter from "grapheme-splitter";
|
|
6
|
+
import { logger, config } from "../analyze";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* This class is used to build a Famix model for the index file anchors
|
|
@@ -25,14 +26,24 @@ export class FamixFunctionsIndex {
|
|
|
25
26
|
* @param sourceElement A source element
|
|
26
27
|
* @param famixElement The Famix model of the source element
|
|
27
28
|
*/
|
|
28
|
-
public makeFamixIndexFileAnchor(sourceElement: SourceFile | ModuleDeclaration | ClassDeclaration | InterfaceDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature | FunctionDeclaration | FunctionExpression | ParameterDeclaration | VariableDeclaration | PropertyDeclaration | PropertySignature | TypeParameterDeclaration | Identifier | Decorator | GetAccessorDeclaration | SetAccessorDeclaration | ImportSpecifier | CommentRange | EnumDeclaration | EnumMember | TypeAliasDeclaration | ExpressionWithTypeArguments, famixElement: Famix.SourcedEntity): void {
|
|
29
|
+
public makeFamixIndexFileAnchor(sourceElement: ImportDeclaration | SourceFile | ModuleDeclaration | ClassDeclaration | InterfaceDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature | FunctionDeclaration | FunctionExpression | ParameterDeclaration | VariableDeclaration | PropertyDeclaration | PropertySignature | TypeParameterDeclaration | Identifier | Decorator | GetAccessorDeclaration | SetAccessorDeclaration | ImportSpecifier | CommentRange | EnumDeclaration | EnumMember | TypeAliasDeclaration | ExpressionWithTypeArguments, famixElement: Famix.SourcedEntity): void {
|
|
30
|
+
logger.debug("making index file anchor for '" + sourceElement?.getText() + "' with famixElement " + famixElement.getJSON());
|
|
29
31
|
const fmxIndexFileAnchor = new Famix.IndexedFileAnchor(this.famixRep);
|
|
30
32
|
fmxIndexFileAnchor.setElement(famixElement);
|
|
31
33
|
|
|
32
34
|
if (sourceElement !== null) {
|
|
33
35
|
fmxIndexFileAnchor.setFileName(sourceElement.getSourceFile().getFilePath());
|
|
36
|
+
let sourceStart, sourceEnd, sourceLineStart, sourceLineEnd: number;
|
|
34
37
|
if (!(sourceElement instanceof CommentRange)) {
|
|
35
|
-
|
|
38
|
+
sourceStart = sourceElement.getStart();
|
|
39
|
+
sourceEnd = sourceElement.getEnd();
|
|
40
|
+
sourceLineStart = sourceElement.getStartLineNumber();
|
|
41
|
+
sourceLineEnd = sourceElement.getEndLineNumber();
|
|
42
|
+
} else {
|
|
43
|
+
sourceStart = sourceElement.getPos();
|
|
44
|
+
sourceEnd = sourceElement.getEnd();
|
|
45
|
+
}
|
|
46
|
+
if (config.expectGraphemes) {
|
|
36
47
|
/**
|
|
37
48
|
* The following logic handles the case of multi-code point characters (e.g. emoji) in the source text.
|
|
38
49
|
* This is needed because Pharo/Smalltalk treats multi-code point characters as a single character,
|
|
@@ -47,31 +58,36 @@ export class FamixFunctionsIndex {
|
|
|
47
58
|
const sourceFileText = sourceElement.getSourceFile().getFullText();
|
|
48
59
|
const hasGraphemeClusters = splitter.countGraphemes(sourceFileText) > 1;
|
|
49
60
|
if (hasGraphemeClusters) {
|
|
50
|
-
const sourceElementText = sourceFileText.substring(
|
|
61
|
+
const sourceElementText = sourceFileText.substring(sourceStart, sourceEnd);
|
|
51
62
|
const sourceElementTextGraphemes = splitter.splitGraphemes(sourceElementText);
|
|
52
63
|
const sourceFileTextGraphemes = splitter.splitGraphemes(sourceFileText);
|
|
53
|
-
const
|
|
54
|
-
const numberOfGraphemeClustersBeforeStart = splitter.countGraphemes(sourceFileText.substring(0, start));
|
|
64
|
+
const numberOfGraphemeClustersBeforeStart = splitter.countGraphemes(sourceFileText.substring(0, sourceStart));
|
|
55
65
|
|
|
56
66
|
// find the start of the sourceElementTextGraphemes array in the sourceFileTextGraphemes array
|
|
57
|
-
|
|
67
|
+
sourceStart = indexOfSplitArray({searchArray: sourceFileTextGraphemes,
|
|
58
68
|
targetArray: sourceElementTextGraphemes,
|
|
59
|
-
start:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
69
|
+
start: sourceStart - numberOfGraphemeClustersBeforeStart});
|
|
70
|
+
sourceEnd = sourceStart + sourceElementTextGraphemes.length;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// note: the +1 is because the source anchor is 1-based, but ts-morph is 0-based
|
|
74
|
+
fmxIndexFileAnchor.setStartPos(sourceStart + 1);
|
|
75
|
+
fmxIndexFileAnchor.setEndPos(sourceEnd + 1);
|
|
76
|
+
if (!(sourceElement instanceof CommentRange)) {
|
|
77
|
+
fmxIndexFileAnchor.setStartLine(sourceLineStart);
|
|
78
|
+
fmxIndexFileAnchor.setEndLine(sourceLineEnd);
|
|
70
79
|
}
|
|
71
80
|
|
|
72
81
|
if (!(famixElement instanceof Famix.Association) && !(famixElement instanceof Famix.Comment) && !(sourceElement instanceof CommentRange) && !(sourceElement instanceof Identifier) && !(sourceElement instanceof ImportSpecifier) && !(sourceElement instanceof ExpressionWithTypeArguments)) {
|
|
73
82
|
(famixElement as Famix.NamedEntity).setFullyQualifiedName(this.FQNFunctions.getFQN(sourceElement));
|
|
74
83
|
}
|
|
84
|
+
} else {
|
|
85
|
+
// sourceElement is null
|
|
86
|
+
logger.warn("sourceElement is null for famixElement " + famixElement.getJSON());
|
|
87
|
+
fmxIndexFileAnchor.setFileName("unknown");
|
|
88
|
+
fmxIndexFileAnchor.setStartPos(0);
|
|
89
|
+
fmxIndexFileAnchor.setEndPos(0);
|
|
90
|
+
|
|
75
91
|
}
|
|
76
92
|
}
|
|
77
93
|
}
|
|
@@ -3,6 +3,7 @@ import * as Famix from "../lib/famix/src/model/famix";
|
|
|
3
3
|
import { FamixRepository } from "../lib/famix/src/famix_repository";
|
|
4
4
|
import { FQNFunctions } from "../fqn";
|
|
5
5
|
import { FamixFunctionsIndex } from "./famix_functions_index";
|
|
6
|
+
import { logger } from "../analyze";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* This class is used to build a Famix model for the types
|
|
@@ -34,7 +35,7 @@ export class FamixFunctionsTypes {
|
|
|
34
35
|
let isPrimitiveType = false;
|
|
35
36
|
let isParameterizedType = false;
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
logger.debug("Creating (or getting) type: '" + typeName + "' of element: " + element.getText() + " of kind: " + element.getKindName());
|
|
38
39
|
|
|
39
40
|
const typeAncestor = this.findTypeAncestor(element);
|
|
40
41
|
const ancestorFullyQualifiedName = this.FQNFunctions.getFQN(typeAncestor);
|
package/src/generate_uml.sh
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FamixBaseElement } from "./famix_base_element";
|
|
2
|
-
import { Class, Interface, Namespace, Variable, Method, Function as FamixFunctionEntity, Type, NamedEntity, ScriptEntity, Module } from "./model/famix";
|
|
2
|
+
import { Class, Interface, Namespace, Variable, Method, Function as FamixFunctionEntity, Type, NamedEntity, ScriptEntity, Module, SourceLanguage } from "./model/famix";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This class is used to store all Famix elements
|
|
6
6
|
*/
|
|
7
7
|
export class FamixRepository {
|
|
8
|
-
|
|
9
8
|
private elements = new Set<FamixBaseElement>(); // All Famix elements
|
|
10
9
|
private famixClasses = new Set<Class>(); // All Famix classes
|
|
11
10
|
private famixInterfaces = new Set<Interface>(); // All Famix interfaces
|
|
@@ -16,6 +15,10 @@ export class FamixRepository {
|
|
|
16
15
|
private famixFiles = new Set<ScriptEntity | Module>(); // All Famix files
|
|
17
16
|
private idCounter = 1; // Id counter
|
|
18
17
|
|
|
18
|
+
constructor() {
|
|
19
|
+
this.addElement(new SourceLanguage(this)); // add the source language entity (TypeScript)
|
|
20
|
+
}
|
|
21
|
+
|
|
19
22
|
/**
|
|
20
23
|
* Gets a Famix entity by id
|
|
21
24
|
* @param id An id of a Famix entity
|
|
@@ -37,7 +40,13 @@ export class FamixRepository {
|
|
|
37
40
|
return entity;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
export(arg0: { format: string; }) {
|
|
44
|
+
if(arg0.format === "json") {
|
|
45
|
+
return this.getJSON();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
41
50
|
// Only for tests
|
|
42
51
|
|
|
43
52
|
/**
|
|
@@ -39,9 +39,9 @@ export class Access extends Association {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
public getJSON(): string {
|
|
42
|
-
const
|
|
43
|
-
this.addPropertiesToExporter(
|
|
44
|
-
return
|
|
42
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Access", this);
|
|
43
|
+
this.addPropertiesToExporter(json);
|
|
44
|
+
return json.getJSON();
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -4,9 +4,9 @@ import { Method } from "./method";
|
|
|
4
4
|
export class Accessor extends Method {
|
|
5
5
|
|
|
6
6
|
public getJSON(): string {
|
|
7
|
-
const
|
|
8
|
-
this.addPropertiesToExporter(
|
|
9
|
-
return
|
|
7
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Accessor", this);
|
|
8
|
+
this.addPropertiesToExporter(json);
|
|
9
|
+
return json.getJSON();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -28,9 +28,9 @@ export class Alias extends NamedEntity {
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
public getJSON(): string {
|
|
31
|
-
const
|
|
32
|
-
this.addPropertiesToExporter(
|
|
33
|
-
return
|
|
31
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Alias", this);
|
|
32
|
+
this.addPropertiesToExporter(json);
|
|
33
|
+
return json.getJSON();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -31,9 +31,9 @@ export class Association extends SourcedEntity {
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
public getJSON(): string {
|
|
34
|
-
const
|
|
35
|
-
this.addPropertiesToExporter(
|
|
36
|
-
return
|
|
34
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Association", this);
|
|
35
|
+
this.addPropertiesToExporter(json);
|
|
36
|
+
return json.getJSON();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -3,7 +3,7 @@ import { Type } from "./type";
|
|
|
3
3
|
import { ContainerEntity } from "./container_entity";
|
|
4
4
|
import { Parameter } from "./parameter";
|
|
5
5
|
import { Invocation } from "./invocation";
|
|
6
|
-
import {
|
|
6
|
+
import { ParameterType } from "./parameter_type";
|
|
7
7
|
|
|
8
8
|
export class BehavioralEntity extends ContainerEntity {
|
|
9
9
|
|
|
@@ -74,13 +74,13 @@ export class BehavioralEntity extends ContainerEntity {
|
|
|
74
74
|
declaredType.addBehavioralEntityWithDeclaredType(this);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
private typeParameters: Set<
|
|
77
|
+
private typeParameters: Set<ParameterType> = new Set();
|
|
78
78
|
|
|
79
|
-
public
|
|
79
|
+
public getParameterTypes(): Set<ParameterType> {
|
|
80
80
|
return this.typeParameters;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
public
|
|
83
|
+
public addParameterType(typeParameter: ParameterType): void {
|
|
84
84
|
if (!this.typeParameters.has(typeParameter)) {
|
|
85
85
|
this.typeParameters.add(typeParameter);
|
|
86
86
|
typeParameter.setParentGeneric(this);
|
|
@@ -89,9 +89,9 @@ export class BehavioralEntity extends ContainerEntity {
|
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
public getJSON(): string {
|
|
92
|
-
const
|
|
93
|
-
this.addPropertiesToExporter(
|
|
94
|
-
return
|
|
92
|
+
const json: FamixJSONExporter = new FamixJSONExporter("BehavioralEntity", this);
|
|
93
|
+
this.addPropertiesToExporter(json);
|
|
94
|
+
return json.getJSON();
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -102,6 +102,6 @@ export class BehavioralEntity extends ContainerEntity {
|
|
|
102
102
|
exporter.addProperty("numberOfParameters", this.getNumberOfParameters());
|
|
103
103
|
exporter.addProperty("incomingInvocations", this.getIncomingInvocations());
|
|
104
104
|
exporter.addProperty("declaredType", this.getDeclaredType());
|
|
105
|
-
exporter.addProperty("typeParameters", this.
|
|
105
|
+
exporter.addProperty("typeParameters", this.getParameterTypes());
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -70,9 +70,9 @@ export class Class extends Type {
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
public getJSON(): string {
|
|
73
|
-
const
|
|
74
|
-
this.addPropertiesToExporter(
|
|
75
|
-
return
|
|
73
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Class", this);
|
|
74
|
+
this.addPropertiesToExporter(json);
|
|
75
|
+
return json.getJSON();
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -36,9 +36,9 @@ export class Comment extends SourcedEntity {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
public getJSON(): string {
|
|
39
|
-
const
|
|
40
|
-
this.addPropertiesToExporter(
|
|
41
|
-
return
|
|
39
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Comment", this);
|
|
40
|
+
this.addPropertiesToExporter(json);
|
|
41
|
+
return json.getJSON();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -143,9 +143,9 @@ export class ContainerEntity extends NamedEntity {
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
public getJSON(): string {
|
|
146
|
-
const
|
|
147
|
-
this.addPropertiesToExporter(
|
|
148
|
-
return
|
|
146
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ContainerEntity", this);
|
|
147
|
+
this.addPropertiesToExporter(json);
|
|
148
|
+
return json.getJSON();
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -26,9 +26,9 @@ export class Decorator extends NamedEntity {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
public getJSON(): string {
|
|
29
|
-
const
|
|
30
|
-
this.addPropertiesToExporter(
|
|
31
|
-
return
|
|
29
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Decorator", this);
|
|
30
|
+
this.addPropertiesToExporter(json);
|
|
31
|
+
return json.getJSON();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -4,9 +4,9 @@ import { FamixBaseElement } from "../../famix_base_element";
|
|
|
4
4
|
export class Entity extends FamixBaseElement {
|
|
5
5
|
|
|
6
6
|
public getJSON(): string {
|
|
7
|
-
const
|
|
8
|
-
this.addPropertiesToExporter(
|
|
9
|
-
return
|
|
7
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Entity", this);
|
|
8
|
+
this.addPropertiesToExporter(json);
|
|
9
|
+
return json.getJSON();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -19,9 +19,9 @@ export class Enum extends Type {
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
public getJSON(): string {
|
|
22
|
-
const
|
|
23
|
-
this.addPropertiesToExporter(
|
|
24
|
-
return
|
|
22
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Enum", this);
|
|
23
|
+
this.addPropertiesToExporter(json);
|
|
24
|
+
return json.getJSON();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -17,9 +17,9 @@ export class EnumValue extends StructuralEntity {
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
public getJSON(): string {
|
|
20
|
-
const
|
|
21
|
-
this.addPropertiesToExporter(
|
|
22
|
-
return
|
|
20
|
+
const json: FamixJSONExporter = new FamixJSONExporter("EnumValue", this);
|
|
21
|
+
this.addPropertiesToExporter(json);
|
|
22
|
+
return json.getJSON();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -4,9 +4,9 @@ import { BehavioralEntity } from "./behavioral_entity";
|
|
|
4
4
|
export class Function extends BehavioralEntity {
|
|
5
5
|
|
|
6
6
|
public getJSON(): string {
|
|
7
|
-
const
|
|
8
|
-
this.addPropertiesToExporter(
|
|
9
|
-
return
|
|
7
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Function", this);
|
|
8
|
+
this.addPropertiesToExporter(json);
|
|
9
|
+
return json.getJSON();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -4,9 +4,9 @@ import { Variable } from "./variable";
|
|
|
4
4
|
export class ImplicitVariable extends Variable {
|
|
5
5
|
|
|
6
6
|
public getJSON(): string {
|
|
7
|
-
const
|
|
8
|
-
this.addPropertiesToExporter(
|
|
9
|
-
return
|
|
7
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ImplicitVariable", this);
|
|
8
|
+
this.addPropertiesToExporter(json);
|
|
9
|
+
return json.getJSON();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
@@ -39,9 +39,9 @@ export class ImportClause extends Association {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
public getJSON(): string {
|
|
42
|
-
const
|
|
43
|
-
this.addPropertiesToExporter(
|
|
44
|
-
return
|
|
42
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ImportClause", this);
|
|
43
|
+
this.addPropertiesToExporter(json);
|
|
44
|
+
return json.getJSON();
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|