From 9c8da69866989bdc85b0744c7be7008224799952 Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Wed, 29 Jul 2026 12:49:53 -0400 Subject: [PATCH 1/7] Added changes suggested by alesshosry --- .../FamixTypeScriptGenerator.class.st | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st index 921d8c2..669be38 100644 --- a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st +++ b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st @@ -208,7 +208,6 @@ FamixTypeScriptGenerator >> defineClasses [ namespace := builder newClassNamed: #Namespace. parameter := builder newClassNamed: #Parameter. parametricClass := builder newClassNamed: #ParametricClass. - parameterConcretization := builder newClassNamed: #ParameterConcretization comment: self commentForParameterConcretization. parametricInterface := builder newClassNamed: #ParametricInterface. parameterType := builder newClassNamed: #ParameterType. primitiveType := builder newClassNamed: #PrimitiveType comment: 'I represent a TypeScript primitive type (string, number, boolean).'. @@ -358,8 +357,8 @@ FamixTypeScriptGenerator >> defineHierarchy [ parameter --|> #TParameter. parameterType --|> type. - parameterType --|> #TGenericParameterType. - parameterType --|> #TTypedEntity. + parameterType --|> #TTypeParameter. + parameterType --|> #TTypeArgument. parametricClass --|> class. "parameterizableClass --|> #TWithParameterizedTypes." @@ -382,14 +381,9 @@ FamixTypeScriptGenerator >> defineHierarchy [ primitiveType --|> #TPrimitiveType. sourcedEntity --|> #TWithComments. - - type --|> #TConcreteParameterType. - type --|> containerEntity. concretization --|> #TConcretization. - parameterConcretization --|> #TParameterConcretization. - property --|> structuralEntity. property --|> #TAttribute. property --|> #TCanBeClassSide. @@ -408,6 +402,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ tWithInterfaces --|> #TWithTypes. type --|> containerEntity. + type --|> #TTypeArgument. type --|> #TType. "type --|> #TParameterizedTypeUser." type --|> #TWithMethods. From 15ea64d465ab214ebbe822d34f1c09dc645cd30f Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Wed, 29 Jul 2026 12:52:48 -0400 Subject: [PATCH 2/7] Regenerated Entities for Moose 13 --- .../FamixTypeScriptAccess.class.st | 5 +- .../FamixTypeScriptAccessor.class.st | 3 +- .../FamixTypeScriptAlias.class.st | 3 +- .../FamixTypeScriptArrowFunction.class.st | 5 +- .../FamixTypeScriptBehaviouralEntity.class.st | 3 +- .../FamixTypeScriptClass.class.st | 5 +- .../FamixTypeScriptComment.class.st | 3 +- .../FamixTypeScriptConcretization.class.st | 9 +- .../FamixTypeScriptContainerEntity.class.st | 3 +- .../FamixTypeScriptDecorator.class.st | 7 +- .../FamixTypeScriptEntity.class.st | 17 ++- .../FamixTypeScriptEnum.class.st | 5 +- .../FamixTypeScriptEnumValue.class.st | 11 +- .../FamixTypeScriptFile.class.st | 3 +- .../FamixTypeScriptFolder.class.st | 3 +- .../FamixTypeScriptFunction.class.st | 5 +- .../FamixTypeScriptImplementation.class.st | 3 +- .../FamixTypeScriptImportClause.class.st | 3 +- .../FamixTypeScriptImportingContext.class.st | 16 +-- .../FamixTypeScriptIndexedFileAnchor.class.st | 3 +- .../FamixTypeScriptInheritance.class.st | 3 +- .../FamixTypeScriptInterface.class.st | 3 +- .../FamixTypeScriptInvocation.class.st | 3 +- .../FamixTypeScriptJSDoc.class.st | 3 +- .../FamixTypeScriptMethod.class.st | 7 +- .../FamixTypeScriptModel.class.st | 5 +- .../FamixTypeScriptModule.class.st | 45 ++++++- .../FamixTypeScriptNamedEntity.class.st | 3 +- .../FamixTypeScriptNamespace.class.st | 3 +- .../FamixTypeScriptParameter.class.st | 11 +- ...TypeScriptParameterConcretization.class.st | 73 ----------- .../FamixTypeScriptParameterType.class.st | 28 +---- ...TypeScriptParametricArrowFunction.class.st | 16 +-- .../FamixTypeScriptParametricClass.class.st | 16 +-- ...FamixTypeScriptParametricFunction.class.st | 16 +-- ...amixTypeScriptParametricInterface.class.st | 16 +-- .../FamixTypeScriptParametricMethod.class.st | 16 +-- .../FamixTypeScriptPrimitiveType.class.st | 5 +- .../FamixTypeScriptProperty.class.st | 15 ++- .../FamixTypeScriptReference.class.st | 3 +- .../FamixTypeScriptScopingEntity.class.st | 3 +- .../FamixTypeScriptScriptEntity.class.st | 3 +- .../FamixTypeScriptSourceAnchor.class.st | 3 +- .../FamixTypeScriptSourceLanguage.class.st | 3 +- .../FamixTypeScriptSourceTextAnchor.class.st | 3 +- .../FamixTypeScriptSourcedEntity.class.st | 3 +- .../FamixTypeScriptStructuralEntity.class.st | 11 +- .../FamixTypeScriptTClassMetrics.trait.st | 3 +- .../FamixTypeScriptTEntityCreator.trait.st | 115 ++++++++++++++++-- .../FamixTypeScriptTFunctionMetrics.trait.st | 3 +- .../FamixTypeScriptTWithInterfaces.trait.st | 3 +- .../FamixTypeScriptType.class.st | 16 +-- .../FamixTypeScriptVariable.class.st | 11 +- .../FamixTypeScriptimplicitVariable.class.st | 3 +- 54 files changed, 280 insertions(+), 308 deletions(-) delete mode 100644 src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st index 0bf8d94..7a991eb 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st @@ -10,7 +10,7 @@ ### Association target | Relation | Origin | Opposite | Type | Comment | |---| -| `variable` | `FamixTAccess` | `incomingAccesses` | `FamixTAccessible` | Variable accessed. to-side of the association| +| `candidates` | `FamixTAccess` | `incomingAccesses` | `FamixTAccessible` | Variables that cas be the accessed variable. to-side of the association. Most of the time it will be only one variable, but some languages might have candidates such as Python.| ### Other | Relation | Origin | Opposite | Type | Comment | @@ -42,7 +42,6 @@ Class { FamixTypeScriptAccess class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st index 01606d1..4e7540d 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptAccessor class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st index d8df67b..89ed86b 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st @@ -24,7 +24,6 @@ Class { FamixTypeScriptAlias class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st index d784c6f..e566f23 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st @@ -22,6 +22,7 @@ I represent a TypeScript arrow function. | `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.| | `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.| | `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | @@ -32,7 +33,6 @@ I represent a TypeScript arrow function. ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -61,7 +61,6 @@ Class { FamixTypeScriptArrowFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st index 9bb2681..2dbdc56 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptBehaviouralEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st index 3c9474b..4d7c5ce 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st @@ -29,6 +29,7 @@ I represent a TypeScript class. |---| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| | `subInheritances` | `FamixTWithInheritances` | `superclass` | `FamixTInheritance` | Subinheritance relationships, i.e. known subclasses of this type.| ### Other @@ -36,7 +37,6 @@ I represent a TypeScript class. |---| | `receivingInvocations` | `FamixTInvocationsReceiver` | `receiver` | `FamixTInvocation` | List of invocations performed on this entity (considered as the receiver)| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -63,9 +63,8 @@ Class { FamixTypeScriptClass class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st index ee0c4f7..ff7532c 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st @@ -38,9 +38,8 @@ Class { FamixTypeScriptComment class >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st index 46190cd..c380a20 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st @@ -35,20 +35,20 @@ ### Association source | Relation | Origin | Opposite | Type | Comment | |---| -| `genericEntity` | `FamixTConcretization` | `concretizations` | `FamixTParametricEntity` | Generic entity linked to in this relationship. from-side of the association| +| `typeArgument` | `FamixTConcretization` | `outgoingConcretizations` | `FamixTTypeArgument` | The type argument that concretizes the type parameter| ### Association target | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteEntity` | `FamixTConcretization` | `genericization` | `FamixTParametricEntity` | Concrete entity linked to in this relationship. to-side of the association| +| `typeParameter` | `FamixTConcretization` | `concretizations` | `FamixTTypeParameter` | Type parameter linked to in this relationship.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| | `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `parameterConcretizations` | `FamixTConcretization` | `concretizations` | `FamixTParameterConcretization` | | | `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| +| `triggeringAssociation` | `FamixTConcretization` | `concretizations` | `FamixTParametricAssociation` | The association that triggers this concretization.| @@ -67,7 +67,6 @@ Class { FamixTypeScriptConcretization class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st index 3cc8174..6098e65 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st @@ -26,7 +26,6 @@ Class { FamixTypeScriptContainerEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st index 8bd73a4..d3611b4 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st @@ -29,8 +29,8 @@ Class { #traits : 'FamixTImportable', #classTraits : 'FamixTImportable classTrait', #instVars : [ - '#expression => FMProperty', - '#decoratedEntity => FMOne type: #FamixTypeScriptNamedEntity opposite: #decorators' + '#decoratedEntity => FMOne type: #FamixTypeScriptNamedEntity opposite: #decorators', + '#expression => FMProperty' ], #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', @@ -41,9 +41,8 @@ Class { FamixTypeScriptDecorator class >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st index 323c43a..7b84119 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st @@ -10,10 +10,9 @@ Class { FamixTypeScriptEntity class >> annotation [ - + - ^ self ] { #category : 'testing' } @@ -30,6 +29,20 @@ FamixTypeScriptEntity class >> metamodel [ ^ FamixTypeScriptModel metamodel ] +{ #category : 'testing' } +FamixTypeScriptEntity >> canBeStub [ + + + ^ false +] + +{ #category : 'testing' } +FamixTypeScriptEntity >> hasImmediateSource [ + + + ^ false +] + { #category : 'testing' } FamixTypeScriptEntity >> isAccess [ diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st index 6e66ae7..e58657e 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st @@ -19,12 +19,12 @@ I represent a Typescript enumerated type |---| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -50,7 +50,6 @@ Class { FamixTypeScriptEnum class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st index 3cd6c11..204af12 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st @@ -9,15 +9,19 @@ I represent One value (constant) in a Typescript enumerated type |---| | `parentEnum` | `FamixTEnumValue` | `enumValues` | `FamixTWithEnumValues` | The Enum declaring this value. It offers the implementation of belongsTo| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -44,7 +48,6 @@ Class { FamixTypeScriptEnumValue class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st index 9a8355e..e0daf3d 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st @@ -35,7 +35,6 @@ Class { FamixTypeScriptFile class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st index 8972f56..02e4186 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st @@ -35,7 +35,6 @@ Class { FamixTypeScriptFolder class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st index 35f9208..27d2a00 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st @@ -22,6 +22,7 @@ I represent a TypeScript function. | `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.| | `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.| | `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | @@ -32,7 +33,6 @@ I represent a TypeScript function. ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -61,7 +61,6 @@ Class { FamixTypeScriptFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st index 8929e41..023ca6a 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st @@ -38,7 +38,6 @@ Class { FamixTypeScriptImplementation class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st index 9b58c92..6e0c9c2 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st @@ -36,7 +36,6 @@ Class { FamixTypeScriptImportClause class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st index 51bbe8c..7defb4b 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st @@ -1,6 +1,8 @@ " This class is used to choose the entities to be imported when loading a model from file. It is used by `MiImportingContextPresenter` in a `MiImportModelFromFileDialog` to import a FamixTypeScriptModel. + + " Class { #name : 'FamixTypeScriptImportingContext', @@ -199,13 +201,6 @@ FamixTypeScriptImportingContext >> importParameter [ ^ self importConcreteEntity: (self class fm3ClassNamed: #Parameter) ] -{ #category : 'importing' } -FamixTypeScriptImportingContext >> importParameterConcretization [ - - - ^ self importAssociation: (self class fm3ClassNamed: #ParameterConcretization) -] - { #category : 'importing' } FamixTypeScriptImportingContext >> importParameterType [ @@ -507,13 +502,6 @@ FamixTypeScriptImportingContext >> shouldImportParameter [ ^ self shouldImport: #Parameter ] -{ #category : 'testing' } -FamixTypeScriptImportingContext >> shouldImportParameterConcretization [ - - - ^ self shouldImport: #ParameterConcretization -] - { #category : 'testing' } FamixTypeScriptImportingContext >> shouldImportParameterType [ diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st index 5bab1ae..eb2ec98 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st @@ -25,7 +25,6 @@ Class { FamixTypeScriptIndexedFileAnchor class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st index adcf8e1..a1e5b19 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st @@ -36,7 +36,6 @@ Class { FamixTypeScriptInheritance class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st index 4350cb1..bdd8836 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st @@ -43,9 +43,8 @@ Class { FamixTypeScriptInterface class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st index 692edd8..ae01d64 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st @@ -43,7 +43,6 @@ Class { FamixTypeScriptInvocation class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st index 2df817f..7851e19 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptJSDoc class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st index 4aefb0f..0d89f51 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st @@ -22,6 +22,7 @@ I represent a TypeScript method. | `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.| | `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.| | `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | @@ -32,7 +33,6 @@ I represent a TypeScript method. ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -44,7 +44,7 @@ I represent a TypeScript method. | `isAbstract` | `Boolean` | false | Entity can be declared abstract| | `isClassSide` | `Boolean` | false | Entity can be declared class side i.e. static| | `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| -| `kind` | `String` | nil | Tag indicating a setter, getter, constant, constructor method| +| `kind` | `String` | nil | Tag indicating a setter, getter, constant method| | `name` | `String` | nil | Basic name of the entity, not full reference.| | `signature` | `String` | nil | Signature of the message being sent| | `visibility` | `String` | nil | Visibility of the entity| @@ -64,7 +64,6 @@ Class { FamixTypeScriptMethod class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st index 2f5a19b..9574ee4 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st @@ -16,8 +16,9 @@ FamixTypeScriptModel class >> allSubmetamodelsPackagesNames [ { #category : 'meta' } FamixTypeScriptModel class >> annotation [ - - + + + ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st index bc31b2d..0b74e45 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st @@ -47,7 +47,48 @@ Class { FamixTypeScriptModule class >> annotation [ - + - ^ self +] + +{ #category : 'accessing' } +FamixTypeScriptModule >> isAmbient [ + + + + ^ isAmbient ifNil: [ isAmbient := false ] +] + +{ #category : 'accessing' } +FamixTypeScriptModule >> isAmbient: anObject [ + + isAmbient := anObject +] + +{ #category : 'accessing' } +FamixTypeScriptModule >> isModule [ + + + + ^ isModule ifNil: [ isModule := false ] +] + +{ #category : 'accessing' } +FamixTypeScriptModule >> isModule: anObject [ + + isModule := anObject +] + +{ #category : 'accessing' } +FamixTypeScriptModule >> isNamespace [ + + + + ^ isNamespace ifNil: [ isNamespace := false ] +] + +{ #category : 'accessing' } +FamixTypeScriptModule >> isNamespace: anObject [ + + isNamespace := anObject ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st index a69e644..186f064 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st @@ -39,10 +39,9 @@ Class { FamixTypeScriptNamedEntity class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st index f098b10..38ead35 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st @@ -41,7 +41,6 @@ Class { FamixTypeScriptNamespace class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st index cd23d6b..5cde535 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st @@ -7,15 +7,19 @@ |---| | `parentBehaviouralEntity` | `FamixTParameter` | `parameters` | `FamixTWithParameters` | Behavioural entity containing this parameter. belongsTo implementation| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -42,7 +46,6 @@ Class { FamixTypeScriptParameter class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st deleted file mode 100644 index 3245f90..0000000 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st +++ /dev/null @@ -1,73 +0,0 @@ -" -## Relations -====================== - -### Association source -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericParameter` | `FamixTParameterConcretization` | `concretizations` | `FamixTGenericParameterType` | Generic parameter linked to in this relationship. from-side of the association| - -### Association target -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concreteParameter` | `FamixTParameterConcretization` | `generics` | `FamixTConcreteParameterType` | Concrete parameter linked to in this relationship. to-side of the association| - -### Other -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParameterConcretization` | `parameterConcretizations` | `FamixTConcretization` | | -| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| - - -## Relations -====================== - -### Association source -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericParameter` | `FamixTParameterConcretization` | `concretizations` | `FamixTGenericParameterType` | Generic parameter linked to in this relationship. from-side of the association| - -### Association target -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concreteParameter` | `FamixTParameterConcretization` | `generics` | `FamixTConcreteParameterType` | Concrete parameter linked to in this relationship. to-side of the association| - -### Other -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParameterConcretization` | `parameterConcretizations` | `FamixTConcretization` | | -| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| - - - -" -Class { - #name : 'FamixTypeScriptParameterConcretization', - #superclass : 'FamixTypeScriptEntity', - #traits : 'FamixTParameterConcretization', - #classTraits : 'FamixTParameterConcretization classTrait', - #category : 'Famix-TypeScript-Entities-Entities', - #package : 'Famix-TypeScript-Entities', - #tag : 'Entities' -} - -{ #category : 'meta' } -FamixTypeScriptParameterConcretization class >> annotation [ - - - - - ^ self -] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st index 9c55a92..7496db6 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st @@ -2,46 +2,31 @@ ## Relations ====================== -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `typeContainer` | `FamixTType` | `types` | `FamixTWithTypes` | Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).| - ### Outgoing dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `concretizations` | `FamixTGenericParameterType` | `genericParameter` | `FamixTParameterConcretization` | Concretization relationships, i.e. known concretizations of this type.| +| `outgoingConcretizations` | `FamixTTypeArgument` | `typeArgument` | `FamixTConcretization` | Concretizations where this type is the type argument.| | `superInheritances` | `FamixTWithInheritances` | `subclass` | `FamixTInheritance` | Superinheritance relationships, i.e. known superclasses of this type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `concretizations` | `FamixTTypeParameter` | `typeParameter` | `FamixTConcretization` | Known concretizations of this type parameter.| | `subInheritances` | `FamixTWithInheritances` | `superclass` | `FamixTInheritance` | Subinheritance relationships, i.e. known subclasses of this type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| -| `genericEntities` | `FamixTGenericParameterType` | `genericParameters` | `FamixTParametricEntity` | The generic entities that use me.| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| +| `genericEntity` | `FamixTTypeParameter` | `typeParameters` | `FamixTParametricEntity` | Generic entity that declares this type parameter.| -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| -| `name` | `String` | nil | Basic name of the entity, not full reference.| " Class { #name : 'FamixTypeScriptParameterType', #superclass : 'FamixTypeScriptType', - #traits : 'FamixTGenericParameterType + FamixTTypedEntity + FamixTWithInheritances', - #classTraits : 'FamixTGenericParameterType classTrait + FamixTTypedEntity classTrait + FamixTWithInheritances classTrait', + #traits : 'FamixTTypeArgument + FamixTTypeParameter + FamixTWithInheritances', + #classTraits : 'FamixTTypeArgument classTrait + FamixTTypeParameter classTrait + FamixTWithInheritances classTrait', #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -51,7 +36,6 @@ Class { FamixTypeScriptParameterType class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st index 01b6e21..fcdca15 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st @@ -4,21 +4,10 @@ I represent a TypeScript parametric arrow function. ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -37,7 +26,6 @@ Class { FamixTypeScriptParametricArrowFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st index 363f3a4..44c2def 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st @@ -2,21 +2,10 @@ ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -35,7 +24,6 @@ Class { FamixTypeScriptParametricClass class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st index 8ec1469..a2bb960 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st @@ -4,21 +4,10 @@ I represent a TypeScript parametric function. ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -37,7 +26,6 @@ Class { FamixTypeScriptParametricFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st index 6b543f7..4b14053 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st @@ -2,21 +2,10 @@ ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -35,7 +24,6 @@ Class { FamixTypeScriptParametricInterface class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st index 46c50d7..020cda7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st @@ -4,21 +4,10 @@ I represent a TypeScript parametric Method. ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -37,7 +26,6 @@ Class { FamixTypeScriptParametricMethod class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st index f7b69f5..331910a 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st @@ -13,12 +13,12 @@ I represent a TypeScript primitive type (string, number, boolean). | Relation | Origin | Opposite | Type | Comment | |---| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -44,9 +44,8 @@ Class { FamixTypeScriptPrimitiveType class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st index fe64a36..2d6b2c7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st @@ -9,15 +9,19 @@ I represent a TypeScript class property. |---| | `parentType` | `FamixTAttribute` | `attributes` | `FamixTWithAttributes` | Type declaring the attribute. belongsTo implementation| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -42,10 +46,10 @@ Class { #traits : 'FamixTAttribute + FamixTCanBeClassSide + FamixTHasVisibility', #classTraits : 'FamixTAttribute classTrait + FamixTCanBeClassSide classTrait + FamixTHasVisibility classTrait', #instVars : [ - '#readOnly => FMProperty defaultValue: false', '#isDefinitelyAssigned => FMProperty defaultValue: false', + '#isJavaScriptPrivate => FMProperty defaultValue: false', '#isOptional => FMProperty defaultValue: false', - '#isJavaScriptPrivate => FMProperty defaultValue: false' + '#readOnly => FMProperty defaultValue: false' ], #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', @@ -56,9 +60,8 @@ Class { FamixTypeScriptProperty class >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st index 4ceafed..f6b8fb9 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st @@ -10,7 +10,6 @@ Class { FamixTypeScriptReference class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st index 6462315..e1bf439 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st @@ -25,7 +25,6 @@ Class { FamixTypeScriptScopingEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st index 4ed3ce5..fe4247a 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st @@ -37,7 +37,6 @@ Class { FamixTypeScriptScriptEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st index 899a255..f6f5ee2 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st @@ -24,10 +24,9 @@ Class { FamixTypeScriptSourceAnchor class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st index d832811..39f1fdf 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st @@ -24,7 +24,6 @@ Class { FamixTypeScriptSourceLanguage class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st index 66a9ea4..dd88529 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st @@ -30,7 +30,6 @@ Class { FamixTypeScriptSourceTextAnchor class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st index dff0ff2..ad172dd 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st @@ -29,10 +29,9 @@ Class { FamixTypeScriptSourcedEntity class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st index f99c432..b6c5615 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st @@ -2,15 +2,19 @@ ## Relations ====================== +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -37,7 +41,6 @@ Class { FamixTypeScriptStructuralEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st index c90691e..6020d13 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st @@ -9,7 +9,6 @@ Trait { FamixTypeScriptTClassMetrics classSide >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st index 1bee109..7fd64d3 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st @@ -15,9 +15,8 @@ Trait { FamixTypeScriptTEntityCreator classSide >> annotation [ - + - ^ self ] { #category : 'entity creation' } @@ -34,6 +33,13 @@ FamixTypeScriptTEntityCreator >> newAccessor [ ^ self add: FamixTypeScriptAccessor new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newAccessorNamed: aName [ + + + ^ self add: (FamixTypeScriptAccessor named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newAlias [ @@ -41,6 +47,13 @@ FamixTypeScriptTEntityCreator >> newAlias [ ^ self add: FamixTypeScriptAlias new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newAliasNamed: aName [ + + + ^ self add: (FamixTypeScriptAlias named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newArrowFunction [ @@ -62,6 +75,13 @@ FamixTypeScriptTEntityCreator >> newBehaviouralEntity [ ^ self add: FamixTypeScriptBehaviouralEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newBehaviouralEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptBehaviouralEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newClass [ @@ -97,6 +117,13 @@ FamixTypeScriptTEntityCreator >> newContainerEntity [ ^ self add: FamixTypeScriptContainerEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newContainerEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptContainerEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newDecorator [ @@ -104,6 +131,13 @@ FamixTypeScriptTEntityCreator >> newDecorator [ ^ self add: FamixTypeScriptDecorator new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newDecoratorNamed: aName [ + + + ^ self add: (FamixTypeScriptDecorator named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newEnum [ @@ -209,6 +243,13 @@ FamixTypeScriptTEntityCreator >> newInterface [ ^ self add: FamixTypeScriptInterface new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newInterfaceNamed: aName [ + + + ^ self add: (FamixTypeScriptInterface named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newInvocation [ @@ -244,6 +285,13 @@ FamixTypeScriptTEntityCreator >> newModule [ ^ self add: FamixTypeScriptModule new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newModuleNamed: aName [ + + + ^ self add: (FamixTypeScriptModule named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newNamespace [ @@ -265,13 +313,6 @@ FamixTypeScriptTEntityCreator >> newParameter [ ^ self add: FamixTypeScriptParameter new ] -{ #category : 'entity creation' } -FamixTypeScriptTEntityCreator >> newParameterConcretization [ - - - ^ self add: FamixTypeScriptParameterConcretization new -] - { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParameterNamed: aName [ @@ -300,6 +341,13 @@ FamixTypeScriptTEntityCreator >> newParametricArrowFunction [ ^ self add: FamixTypeScriptParametricArrowFunction new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricArrowFunctionNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricArrowFunction named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricClass [ @@ -307,6 +355,13 @@ FamixTypeScriptTEntityCreator >> newParametricClass [ ^ self add: FamixTypeScriptParametricClass new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricClassNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricClass named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricFunction [ @@ -314,6 +369,13 @@ FamixTypeScriptTEntityCreator >> newParametricFunction [ ^ self add: FamixTypeScriptParametricFunction new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricFunctionNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricFunction named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricInterface [ @@ -321,6 +383,13 @@ FamixTypeScriptTEntityCreator >> newParametricInterface [ ^ self add: FamixTypeScriptParametricInterface new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricInterfaceNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricInterface named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricMethod [ @@ -328,6 +397,13 @@ FamixTypeScriptTEntityCreator >> newParametricMethod [ ^ self add: FamixTypeScriptParametricMethod new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricMethodNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricMethod named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newPrimitiveType [ @@ -370,6 +446,13 @@ FamixTypeScriptTEntityCreator >> newScopingEntity [ ^ self add: FamixTypeScriptScopingEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newScopingEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptScopingEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newScriptEntity [ @@ -377,6 +460,13 @@ FamixTypeScriptTEntityCreator >> newScriptEntity [ ^ self add: FamixTypeScriptScriptEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newScriptEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptScriptEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newSourceLanguage [ @@ -439,3 +529,10 @@ FamixTypeScriptTEntityCreator >> newimplicitVariable [ ^ self add: FamixTypeScriptimplicitVariable new ] + +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newimplicitVariableNamed: aName [ + + + ^ self add: (FamixTypeScriptimplicitVariable named: aName) +] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st index 99b1621..e5b7c5f 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st @@ -21,9 +21,8 @@ Trait { FamixTypeScriptTFunctionMetrics classSide >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st index 6b6d8ae..e18aff4 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st @@ -25,7 +25,6 @@ Trait { FamixTypeScriptTWithInterfaces classSide >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st index 9c5ab37..330afc7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st @@ -14,19 +14,22 @@ I represent a TypeScript type. |---| | `methods` | `FamixTWithMethods` | `parentType` | `FamixTMethod` | Methods declared by this type.| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `outgoingConcretizations` | `FamixTTypeArgument` | `typeArgument` | `FamixTConcretization` | Concretizations where this type is the type argument.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `generics` | `FamixTConcreteParameterType` | `concreteParameter` | `FamixTParameterConcretization` | Generic relationships, i.e. known genericParameter of this type.| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteEntities` | `FamixTConcreteParameterType` | `concreteParameters` | `FamixTParametricEntity` | The concrete entities that use me.| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -41,8 +44,8 @@ I represent a TypeScript type. Class { #name : 'FamixTypeScriptType', #superclass : 'FamixTypeScriptContainerEntity', - #traits : 'FamixTConcreteParameterType + FamixTImportable + FamixTType + FamixTWithMethods', - #classTraits : 'FamixTConcreteParameterType classTrait + FamixTImportable classTrait + FamixTType classTrait + FamixTWithMethods classTrait', + #traits : 'FamixTImportable + FamixTType + FamixTTypeArgument + FamixTWithMethods', + #classTraits : 'FamixTImportable classTrait + FamixTType classTrait + FamixTTypeArgument classTrait + FamixTWithMethods classTrait', #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -52,7 +55,6 @@ Class { FamixTypeScriptType class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st index 710176f..0cba8b7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st @@ -9,16 +9,20 @@ I represent a TypeScript variable. |---| | `parentBehaviouralEntity` | `FamixTLocalVariable` | `localVariables` | `FamixTWithLocalVariables` | Behavioural entity declaring this local variable. belongsTo implementation| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -45,7 +49,6 @@ Class { FamixTypeScriptVariable class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st index dc05444..d7a9544 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptimplicitVariable class >> annotation [ - + - ^ self ] From 7f30ce77d6952d8dee6b6820da39167a2c8435ca Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Wed, 29 Jul 2026 15:28:39 -0400 Subject: [PATCH 3/7] Overrode isConstructor in FamixTypeScriptMethod and updated tests accordingly. --- .../FamixTypeScriptModule.class.st | 42 ------------------- .../FamixTypeScriptMethod.extension.st | 9 ++++ .../FamixTypeScriptTClassMetrics.extension.st | 37 ++++++++-------- .../FamixTypeScriptClassTest.class.st | 5 +-- .../FamixTypeScriptMethodTest.class.st | 10 +++-- 5 files changed, 34 insertions(+), 69 deletions(-) diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st index 0b74e45..604c8c2 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st @@ -50,45 +50,3 @@ FamixTypeScriptModule class >> annotation [ ] - -{ #category : 'accessing' } -FamixTypeScriptModule >> isAmbient [ - - - - ^ isAmbient ifNil: [ isAmbient := false ] -] - -{ #category : 'accessing' } -FamixTypeScriptModule >> isAmbient: anObject [ - - isAmbient := anObject -] - -{ #category : 'accessing' } -FamixTypeScriptModule >> isModule [ - - - - ^ isModule ifNil: [ isModule := false ] -] - -{ #category : 'accessing' } -FamixTypeScriptModule >> isModule: anObject [ - - isModule := anObject -] - -{ #category : 'accessing' } -FamixTypeScriptModule >> isNamespace [ - - - - ^ isNamespace ifNil: [ isNamespace := false ] -] - -{ #category : 'accessing' } -FamixTypeScriptModule >> isNamespace: anObject [ - - isNamespace := anObject -] diff --git a/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st b/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st index f7a2dde..30aab82 100644 --- a/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st +++ b/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st @@ -9,6 +9,15 @@ FamixTypeScriptMethod >> accessedAttributes [ ^ (self queryOutgoingAccesses opposites withinParentUsing: FamixTClass) asSet select: #isAttribute ] +{ #category : '*Famix-TypeScript-Extensions' } +FamixTypeScriptMethod >> isConstructor [ + + + + + ^ self name = 'constructor' +] + { #category : '*Famix-TypeScript-Extensions' } FamixTypeScriptMethod >> isGetter [ "No parameter AND diff --git a/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st b/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st index 70e81a7..c251643 100644 --- a/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st +++ b/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st @@ -6,15 +6,15 @@ FamixTypeScriptTClassMetrics >> numberOfAccessorMethods [ - ^ self lookUpPropertyNamed: #numberOfAccessorMethods computedAs: [ - | noa | - noa := 0. - self methods do: [ :method | - method isPureAccessor ifNotNil: [ - (method isPureAccessor or: [ - (method propertyNamed: #AccessorMethod) isNotNil ]) ifTrue: [ - noa := noa + 1 ] ] ]. - noa ] + ^ self cacheAt: #numberOfAccessorMethods ifAbsent: [ + | noa | + noa := 0. + self methods do: [ :method | + method isPureAccessor ifNotNil: [ + (method isPureAccessor or: [ + (method propertyNamed: #AccessorMethod) isNotNil ]) + ifTrue: [ noa := noa + 1 ] ] ]. + noa ] ] { #category : '*Famix-TypeScript-Extensions' } @@ -29,14 +29,12 @@ FamixTypeScriptTClassMetrics >> numberOfConstructorMethods [ - ^ self - lookUpPropertyNamed: #numberOfConstructorMethods - computedAs: [ + ^ self cacheAt: #numberOfConstructorMethods ifAbsent: [ | nc | nc := 0. - self methods do: [ :method | - method isConstructor ifNotNil: [ - method isConstructor ifTrue: [ nc := 1 ] ] ]. + self methods do: [ :method | + method isConstructor ifNotNil: [ + method isConstructor ifTrue: [ nc := 1 ] ] ]. nc ] ] @@ -53,8 +51,8 @@ FamixTypeScriptTClassMetrics >> numberOfPrivateMethods [ ^ self - lookUpPropertyNamed: #numberOfPrivateMethods - computedAs: [ + cacheAt: #numberOfPrivateMethods + ifAbsent: [ (self methods select: [ :each | each isPrivate ]) size ] ] @@ -71,9 +69,8 @@ FamixTypeScriptTClassMetrics >> numberOfPublicMethods [ ^ self - lookUpPropertyNamed: #numberOfPublicMethods - computedAs: [ - (self methods select: [ :each | each isPublic ]) size ] + cacheAt: #numberOfPublicMethods + ifAbsent: [ (self methods select: [ :each | each isPublic ]) size ] ] { #category : '*Famix-TypeScript-Extensions' } diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st index 644828d..ad75876 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st @@ -38,10 +38,9 @@ FamixTypeScriptClassTest >> testNumberOfConstructorMethods [ | m1 c1 model | model := FamixTypeScriptModel new. c1 := FamixTypeScriptClass named: 'Class1' model: model. - m1 := FamixTypeScriptMethod named: 'method1' model: model. + m1 := FamixTypeScriptMethod named: 'constructor' model: model. m1 parentType: c1. - - m1 isConstructor: true. + self assert: c1 numberOfConstructorMethods equals: 1. c1 numberOfConstructorMethods: 100. self assert: c1 numberOfConstructorMethods equals: 100. diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st index b33111b..8eed5f0 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st @@ -5,7 +5,8 @@ Class { #name : 'FamixTypeScriptMethodTest', #superclass : 'TestCase', #instVars : [ - 'method' + 'method', + 'constructor' ], #category : 'Famix-TypeScript-Tests-Entities', #package : 'Famix-TypeScript-Tests', @@ -15,7 +16,8 @@ Class { { #category : 'running' } FamixTypeScriptMethodTest >> setUp [ super setUp. - method := FamixTypeScriptMethod new + method := FamixTypeScriptMethod new. + constructor := FamixTypeScriptMethod named: 'constructor'. ] { #category : 'test' } @@ -161,9 +163,9 @@ FamixTypeScriptMethodTest >> testIsClassSide [ { #category : 'test' } FamixTypeScriptMethodTest >> testIsConstructor [ + self assert: constructor isConstructor. + self deny: method isConstructor. - method beConstructor. - self assert: method isConstructor ] { #category : 'test' } From 1b1e62b06786f304b3c0c82634b6842547d22e8f Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Mon, 3 Aug 2026 01:28:55 -0400 Subject: [PATCH 4/7] Fixed tests for Decorator, Method, Source Language, Class Metrics and Script Test --- .../FamixTypeScriptDecorator.class.st | 6 ++- .../FamixTypeScriptEntity.class.st | 7 ++++ .../FamixTypeScriptEntityTyping.class.st | 41 +++++++++++++++++++ .../FamixTypeScriptImportingContext.class.st | 28 +++++++++++++ ...xTypeScriptParametricEntityTyping.class.st | 29 +++++++++++++ .../FamixTypeScriptTEntityCreator.trait.st | 14 +++++++ .../FamixTypeScriptGenerator.class.st | 12 +++++- .../FamixTypeScriptClassTest.class.st | 5 ++- .../FamixTypeScriptDecoratorTest.class.st | 18 ++++---- .../FamixTypeScriptMethodTest.class.st | 26 +++++++----- ...FamixTypeScriptSourceLanguageTest.class.st | 4 +- .../FamixTypeScriptTClassMetricsTest.class.st | 15 ++++--- .../FamixTypeScriptTest.class.st | 10 ++--- 13 files changed, 179 insertions(+), 36 deletions(-) create mode 100644 src/Famix-TypeScript-Entities/FamixTypeScriptEntityTyping.class.st create mode 100644 src/Famix-TypeScript-Entities/FamixTypeScriptParametricEntityTyping.class.st diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st index d3611b4..27f2f0c 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st @@ -13,6 +13,7 @@ I represent a TypeScript Decorator | Relation | Origin | Opposite | Type | Comment | |---| | `decoratedEntity` | `FamixTypeScriptDecorator` | `decorators` | `FamixTypeScriptNamedEntity` | | +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| ## Properties @@ -21,13 +22,14 @@ I represent a TypeScript Decorator | Name | Type | Default value | Comment | |---| | `expression` | `String` | nil | Decorators use the form @expression, where expression must evaluate to a function that will be called at runtime with information about the decorated declaration| +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| " Class { #name : 'FamixTypeScriptDecorator', #superclass : 'FamixTypeScriptNamedEntity', - #traits : 'FamixTImportable', - #classTraits : 'FamixTImportable classTrait', + #traits : 'FamixTCanBeStub + FamixTImportable', + #classTraits : 'FamixTCanBeStub classTrait + FamixTImportable classTrait', #instVars : [ '#decoratedEntity => FMOne type: #FamixTypeScriptNamedEntity opposite: #decorators', '#expression => FMProperty' diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st index 7b84119..9c5a604 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st @@ -155,6 +155,13 @@ FamixTypeScriptEntity >> isNamespace [ ^ false ] +{ #category : 'testing' } +FamixTypeScriptEntity >> isParametricAssociation [ + + + ^ false +] + { #category : 'testing' } FamixTypeScriptEntity >> isParametricEntity [ diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEntityTyping.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEntityTyping.class.st new file mode 100644 index 0000000..fa203c6 --- /dev/null +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEntityTyping.class.st @@ -0,0 +1,41 @@ +" +## Relations +====================== + +### Association source +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typedEntity` | `FamixTEntityTyping` | `typing` | `FamixTTypedEntity` | Entity deckaring the type.| + +### Association target +| Relation | Origin | Opposite | Type | Comment | +|---| +| `declaredType` | `FamixTEntityTyping` | `incomingTypings` | `FamixTType` | Type of the entity.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +|---| +| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| +| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| + + + +" +Class { + #name : 'FamixTypeScriptEntityTyping', + #superclass : 'FamixTypeScriptEntity', + #traits : 'FamixTEntityTyping', + #classTraits : 'FamixTEntityTyping classTrait', + #category : 'Famix-TypeScript-Entities-Entities', + #package : 'Famix-TypeScript-Entities', + #tag : 'Entities' +} + +{ #category : 'meta' } +FamixTypeScriptEntityTyping class >> annotation [ + + + + +] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st index 7defb4b..65b08e9 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st @@ -89,6 +89,13 @@ FamixTypeScriptImportingContext >> importDecorator [ ^ self importConcreteEntity: (self class fm3ClassNamed: #Decorator) ] +{ #category : 'importing' } +FamixTypeScriptImportingContext >> importEntityTyping [ + + + ^ self importAssociation: (self class fm3ClassNamed: #EntityTyping) +] + { #category : 'importing' } FamixTypeScriptImportingContext >> importEnum [ @@ -222,6 +229,13 @@ FamixTypeScriptImportingContext >> importParametricClass [ ^ self importConcreteEntity: (self class fm3ClassNamed: #ParametricClass) ] +{ #category : 'importing' } +FamixTypeScriptImportingContext >> importParametricEntityTyping [ + + + ^ self importConcreteEntity: (self class fm3ClassNamed: #ParametricEntityTyping) +] + { #category : 'importing' } FamixTypeScriptImportingContext >> importParametricFunction [ @@ -390,6 +404,13 @@ FamixTypeScriptImportingContext >> shouldImportDecorator [ ^ self shouldImport: #Decorator ] +{ #category : 'testing' } +FamixTypeScriptImportingContext >> shouldImportEntityTyping [ + + + ^ self shouldImport: #EntityTyping +] + { #category : 'testing' } FamixTypeScriptImportingContext >> shouldImportEnum [ @@ -523,6 +544,13 @@ FamixTypeScriptImportingContext >> shouldImportParametricClass [ ^ self shouldImport: #ParametricClass ] +{ #category : 'testing' } +FamixTypeScriptImportingContext >> shouldImportParametricEntityTyping [ + + + ^ self shouldImport: #ParametricEntityTyping +] + { #category : 'testing' } FamixTypeScriptImportingContext >> shouldImportParametricFunction [ diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricEntityTyping.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricEntityTyping.class.st new file mode 100644 index 0000000..fefa49f --- /dev/null +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricEntityTyping.class.st @@ -0,0 +1,29 @@ +" +## Relations +====================== + +### Other +| Relation | Origin | Opposite | Type | Comment | +|---| +| `concretizations` | `FamixTParametricAssociation` | `triggeringAssociation` | `FamixTConcretization` | The parameter concretizations associated with this association.| + + + +" +Class { + #name : 'FamixTypeScriptParametricEntityTyping', + #superclass : 'FamixTypeScriptEntityTyping', + #traits : 'FamixTParametricAssociation', + #classTraits : 'FamixTParametricAssociation classTrait', + #category : 'Famix-TypeScript-Entities-Entities', + #package : 'Famix-TypeScript-Entities', + #tag : 'Entities' +} + +{ #category : 'meta' } +FamixTypeScriptParametricEntityTyping class >> annotation [ + + + + +] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st index 7fd64d3..5b3e605 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st @@ -138,6 +138,13 @@ FamixTypeScriptTEntityCreator >> newDecoratorNamed: aName [ ^ self add: (FamixTypeScriptDecorator named: aName) ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newEntityTyping [ + + + ^ self add: FamixTypeScriptEntityTyping new +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newEnum [ @@ -362,6 +369,13 @@ FamixTypeScriptTEntityCreator >> newParametricClassNamed: aName [ ^ self add: (FamixTypeScriptParametricClass named: aName) ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricEntityTyping [ + + + ^ self add: FamixTypeScriptParametricEntityTyping new +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricFunction [ diff --git a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st index 669be38..0d984b3 100644 --- a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st +++ b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st @@ -45,7 +45,9 @@ Class { 'parametricInterface', 'concretization', 'parameterConcretization', - 'tTypeScriptFunctionMetrics' + 'tTypeScriptFunctionMetrics', + 'entityTyping', + 'parametricEntityTyping' ], #category : 'Famix-TypeScript-Generator', #package : 'Famix-TypeScript-Generator' @@ -210,12 +212,14 @@ FamixTypeScriptGenerator >> defineClasses [ parametricClass := builder newClassNamed: #ParametricClass. parametricInterface := builder newClassNamed: #ParametricInterface. parameterType := builder newClassNamed: #ParameterType. + parametricEntityTyping := builder newClassNamed: #ParametricEntityTyping. primitiveType := builder newClassNamed: #PrimitiveType comment: 'I represent a TypeScript primitive type (string, number, boolean).'. reference:= builder newClassNamed: #Reference. scriptEntity :=builder newClassNamed: #ScriptEntity. scopingEntity:= builder newClassNamed: #ScopingEntity. structuralEntity := builder newClassNamed: #StructuralEntity. type := builder newClassNamed: #Type comment: 'I represent a TypeScript type.'. + entityTyping := builder newClassNamed: #EntityTyping. variable := builder newClassNamed: #Variable comment: 'I represent a TypeScript variable.'. primitiveType withTesting. @@ -265,6 +269,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ decorator --|> namedEntity. decorator --|> #TImportable. + decorator --|> #TCanBeStub. enum --|> type. enum --|> #TEnum. @@ -408,6 +413,11 @@ FamixTypeScriptGenerator >> defineHierarchy [ type --|> #TWithMethods. type --|> #TImportable. + entityTyping --|> #TEntityTyping. + + parametricEntityTyping --|> entityTyping. + parametricEntityTyping --|> #TParametricAssociation. + variable --|> structuralEntity. variable --|> #TLocalVariable. variable --|> #TImportable. diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st index ad75876..901317f 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st @@ -38,11 +38,12 @@ FamixTypeScriptClassTest >> testNumberOfConstructorMethods [ | m1 c1 model | model := FamixTypeScriptModel new. c1 := FamixTypeScriptClass named: 'Class1' model: model. + + self assert: c1 numberOfConstructorMethods equals: 0. + m1 := FamixTypeScriptMethod named: 'constructor' model: model. m1 parentType: c1. self assert: c1 numberOfConstructorMethods equals: 1. - c1 numberOfConstructorMethods: 100. - self assert: c1 numberOfConstructorMethods equals: 100. ] diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptDecoratorTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptDecoratorTest.class.st index 886134a..7cc6926 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptDecoratorTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptDecoratorTest.class.st @@ -60,61 +60,61 @@ FamixTypeScriptDecoratorTest >> setUp [ name: 'm1'; signature: 'm1()'; parentType: c1; - declaredType: c2; + typing: (FamixTypeScriptEntityTyping new declaredType: c2); yourself. m2 := FamixTypeScriptMethod new stub: true; name: 'm2'; signature: 'm2()'; parentType: c2; - declaredType: c3; + typing: (FamixTypeScriptEntityTyping new declaredType: c3); yourself. m3 := FamixTypeScriptMethod new stub: true; name: 'm3'; signature: 'm3(C2,C3)'; parentType: c2; - declaredType: c1; + typing: (FamixTypeScriptEntityTyping new declaredType: c1); yourself. m4 := FamixTypeScriptMethod new stub: true; name: 'm4'; signature: 'm4()'; parentType: c3; - declaredType: c3; + typing: (FamixTypeScriptEntityTyping new declaredType: c3); yourself. v1 := FamixTypeScriptVariable new stub: true; name: 'v1'; parentBehaviouralEntity: m2; - declaredType: c1; + typing: (FamixTypeScriptEntityTyping new declaredType: c1); yourself. pr1 := FamixTypeScriptParameter new stub: true; name: 'pr1'; parentBehaviouralEntity: m3; - declaredType: c2; + typing: (FamixTypeScriptEntityTyping new declaredType: c2); yourself. pr2 := FamixTypeScriptParameter new stub: true; name: 'pr2'; parentBehaviouralEntity: m3; - declaredType: c3; + typing: (FamixTypeScriptEntityTyping new declaredType: c3); yourself. at1 := FamixTypeScriptProperty new stub: true; name: 'at1'; parentType: c1; - declaredType: c3; + typing: (FamixTypeScriptEntityTyping new declaredType: c3); yourself. at2 := FamixTypeScriptProperty new stub: true; name: 'at2'; parentType: c3; - declaredType: c2; + typing: (FamixTypeScriptEntityTyping new declaredType: c2); yourself. "class decorator" diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st index 8eed5f0..ea5d58e 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st @@ -174,27 +174,32 @@ FamixTypeScriptMethodTest >> testIsGetter [ self deny: method isGetter. method name: 'getLogin'. - method declaredType: (FamixTypeScriptClass named: 'String'). + method typing: (FamixTypeScriptEntityTyping new + declaredType: (FamixTypeScriptClass named: 'String')). self assert: method isGetter. method name: 'getLogin'. - method declaredType: (FamixTypeScriptPrimitiveType named: 'void'). + method typing: (FamixTypeScriptEntityTyping new declaredType: + (FamixTypeScriptPrimitiveType named: 'void')). self deny: method isGetter ] { #category : 'test' } FamixTypeScriptMethodTest >> testIsGetterForBooleanAttribute [ - + method name: 'isActif'. - method declaredType: (FamixTypeScriptPrimitiveType named: 'boolean'). + method typing: (FamixTypeScriptEntityTyping new declaredType: + (FamixTypeScriptPrimitiveType named: 'boolean')). self assert: method isGetter. method name: 'isActif'. - method declaredType: (FamixTypeScriptClass named: 'Boolean'). + method typing: (FamixTypeScriptEntityTyping new declaredType: + (FamixTypeScriptClass named: 'Boolean')). self assert: method isGetter. method name: 'isActif'. - method declaredType: (FamixTypeScriptClass named: 'String'). + method typing: (FamixTypeScriptEntityTyping new declaredType: + (FamixTypeScriptClass named: 'String')). self deny: method isGetter ] @@ -210,7 +215,7 @@ FamixTypeScriptMethodTest >> testIsNotStubWhenParentIsNotStub [ { #category : 'test' } FamixTypeScriptMethodTest >> testIsSetter [ - + self deny: method isSetter. method name: 'setLogin'. @@ -219,7 +224,8 @@ FamixTypeScriptMethodTest >> testIsSetter [ method parameters: { FamixTypeScriptParameter new }. self deny: method isSetter. - method declaredType: (FamixTypeScriptPrimitiveType named: 'void'). + method typing: (FamixTypeScriptEntityTyping new declaredType: + (FamixTypeScriptPrimitiveType named: 'void')). self assert: method isSetter ] @@ -303,13 +309,13 @@ FamixTypeScriptMethodTest >> testOverride [ name: 'method'; signature: 'method()'; parentType: c1; - declaredType: c1; + typing: (FamixTypeScriptEntityTyping new declaredType: c1); yourself. method name: 'method'; signature: 'method()'; parentType: c2; - declaredType: c2. + typing: (FamixTypeScriptEntityTyping new declaredType: c2). c2 addSuperInheritance: (FamixTypeScriptInheritance new diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptSourceLanguageTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptSourceLanguageTest.class.st index 99dcd75..cb604d4 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptSourceLanguageTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptSourceLanguageTest.class.st @@ -12,8 +12,8 @@ FamixTypeScriptSourceLanguageTest >> testIsTypeScript [ model importFromMSEStream: '( - (FamixTypeScript.SourceLanguage) - (FamixTypeScript.Class (id: 2) (name ''ClassA'')) + (Famix-TypeScript-Entities.SourceLanguage) + (Famix-TypeScript-Entities.Class (id: 2) (name ''ClassA'')) )' readStream. self assert: model sourceLanguage isTypeScript ] diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptTClassMetricsTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptTClassMetricsTest.class.st index f061ed1..61ba807 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptTClassMetricsTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptTClassMetricsTest.class.st @@ -27,16 +27,21 @@ FamixTypeScriptTClassMetricsTest >> testNumberOfAccessorMethods [ { #category : 'tests' } FamixTypeScriptTClassMetricsTest >> testNumberOfConstructorMethods [ - | m1 c1 model | + | m1 constructor c1 model | model := FamixTypeScriptModel new. c1 := FamixTypeScriptClass named: 'Class1' model: model. + + self assert: c1 numberOfConstructorMethods equals: 0. + m1 := FamixTypeScriptMethod named: 'method1' model: model. m1 parentType: c1. - - m1 isConstructor: true. + + self assert: c1 numberOfConstructorMethods equals: 0. + + constructor := FamixTypeScriptMethod named: 'constructor' model: model. + constructor parentType: c1. + self assert: c1 numberOfConstructorMethods equals: 1. - c1 numberOfConstructorMethods: 100. - self assert: c1 numberOfConstructorMethods equals: 100 ] { #category : 'test' } diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptTest.class.st index 33611de..719749c 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptTest.class.st @@ -11,11 +11,11 @@ FamixTypeScriptTest >> testImportNamespace [ | model | model := FamixTypeScriptModel new. model importFromMSEStream: '( - (FamixTypeScript.Namespace (id: 1) (name ''ANamespace'')) - (FamixTypeScript.Namespace (id: 10) (name ''AnotherNamespace'')) - (FamixTypeScript.Class (id: 3) (name ''AClass'') (typeContainer (ref: 1))) - (FamixTypeScript.Class (id: 5) (name ''AnotherClass'') (typeContainer (ref: 1))) - (FamixTypeScript.Method (id: 2) (name ''aMethod'') (parentType (ref: 3))) + (Famix-TypeScript-Entities.Namespace (id: 1) (name ''ANamespace'')) + (Famix-TypeScript-Entities.Namespace (id: 10) (name ''AnotherNamespace'')) + (Famix-TypeScript-Entities.Class (id: 3) (name ''AClass'') (typeContainer (ref: 1))) + (Famix-TypeScript-Entities.Class (id: 5) (name ''AnotherClass'') (typeContainer (ref: 1))) + (Famix-TypeScript-Entities.Method (id: 2) (name ''aMethod'') (parentType (ref: 3))) )' readStream. self assert: model allNamespaces size equals: 2. self assert: (model allNamespaces anySatisfy: [ :namespace | From 876f017a67b0ec2d20deeed3ed40a88c144bdf92 Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Mon, 3 Aug 2026 16:31:35 -0400 Subject: [PATCH 5/7] Updated CI to use Moose 13 --- .github/workflows/common.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index d9a460a..1c39f6e 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -15,8 +15,8 @@ jobs: strategy: matrix: # List of images at https://github.com/hpi-swa/smalltalkCI#images - # Use Moose64-11 that includes our visualization tool - smalltalk: [Moose64-11] + # Use Moose64-13 that includes our visualization tool + smalltalk: [Moose64-13] name: ${{ matrix.smalltalk }} steps: - name: Checkout code From 6cc439541188741607bf8bf42c69d196fea54ece Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Mon, 3 Aug 2026 16:42:36 -0400 Subject: [PATCH 6/7] First Attempt to fix parameter tests, skipped them after discussing with Christopher. --- .../FamixTypeScriptGenerator.class.st | 3 +- .../FamixTypeScriptParametricTest.class.st | 170 ++++++++++-------- 2 files changed, 98 insertions(+), 75 deletions(-) diff --git a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st index 0d984b3..d2fe892 100644 --- a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st +++ b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st @@ -47,7 +47,8 @@ Class { 'parameterConcretization', 'tTypeScriptFunctionMetrics', 'entityTyping', - 'parametricEntityTyping' + 'parametricEntityTyping', + 'typeParameter' ], #category : 'Famix-TypeScript-Generator', #package : 'Famix-TypeScript-Generator' diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptParametricTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptParametricTest.class.st index 18c10ed..ac03f09 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptParametricTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptParametricTest.class.st @@ -2,7 +2,11 @@ Class { #name : 'FamixTypeScriptParametricTest', #superclass : 'TestCase', #instVars : [ - 'parametricClass' + 'parametricClass', + 'model', + 'stringClass', + 'listTypeParameter', + 'genericListClass' ], #category : 'Famix-TypeScript-Tests', #package : 'Famix-TypeScript-Tests' @@ -12,8 +16,20 @@ Class { FamixTypeScriptParametricTest >> setUp [ super setUp. + self skip. - parametricClass := FamixJavaParametricClass new name: 'ParametricClass' + parametricClass := FamixTypeScriptParametricClass new name: 'ParametricClass'. + + model := FamixTypeScriptModel new. + + stringClass := model newClassNamed: 'String'. + + listTypeParameter := model newParameterType + name: 'E'; + yourself. + genericListClass := model newParametricClass + name: 'List'; + addTypeParameter: listTypeParameter ] { #category : 'tests' } @@ -30,14 +46,14 @@ FamixTypeScriptParametricTest >> test1 [ parameter := FamixTypeScriptParameter new name: 'list'. list := FamixTypeScriptParametricClass new name: 'Array'. parameterConcretisation := FamixTypeScriptType new name: 'any'. - list addConcreteParameter: parameterConcretisation. - parameter declaredType: list. + "list addConcreteParameter: parameterConcretisation." + parameter typing: (FamixTypeScriptEntityTyping new declaredType: list). method addParameter: parameter. - method declaredType: list. + method typing: (FamixTypeScriptEntityTyping new declaredType: list). function addParameter: parameter. - function declaredType: list. + function typing: (FamixTypeScriptEntityTyping new declaredType: list). parametricArrowFunction addParameter: parameter. - parametricArrowFunction declaredType: list. + parametricArrowFunction typing: (FamixTypeScriptEntityTyping new declaredType: list). ] { #category : 'tests' } @@ -52,7 +68,7 @@ FamixTypeScriptParametricTest >> test2 [ af := FamixTypeScriptParametricArrowFunction new name: 'genericArrowFunction'. p := FamixTypeScriptParameter new name: 't'. parameterType := FamixTypeScriptParameterType named: 'T'. - p declaredType: parameterType. + p typing: (FamixTypeScriptEntityTyping new declaredType: parameterType). m addParameter: p. f addParameter: p. af addParameter: p. @@ -60,9 +76,9 @@ FamixTypeScriptParametricTest >> test2 [ FamixTypeScriptInheritance new subclass: return; superclass: (FamixTypeScriptClass new name: 'Building'). - m declaredType: return. - f declaredType: return. - af declaredType: return. + m typing: (FamixTypeScriptEntityTyping new declaredType: return). + f typing: (FamixTypeScriptEntityTyping new declaredType: return). + af typing: (FamixTypeScriptEntityTyping new declaredType: return). ] { #category : 'tests' } @@ -88,54 +104,46 @@ FamixTypeScriptParametricTest >> test3 [ } " - | classA k v t string number void | - number := FamixTypeScriptPrimitiveType named: 'number'. - string := FamixTypeScriptPrimitiveType named: 'string'. - void := FamixTypeScriptPrimitiveType named: 'void'. - t := FamixTypeScriptParameterType named: 'T'. - - (classA := FamixTypeScriptParametricClass new name: 'ClassA') - genericParameters: { - (k := FamixTypeScriptParameterType new name: 'K'). - (v := FamixTypeScriptParameterType new name: 'V') }. - - FamixTypeScriptConcretization new - concreteEntity: (FamixTypeScriptParametricClass new name: 'ClassA'); - genericEntity: classA. - - FamixTypeScriptParameterConcretization new - concreteParameter: string; - genericParameter: k. - - (FamixTypeScriptMethod named: 'method') - parameters: { - ((FamixTypeScriptParameter named: 'num') declaredType: - (number := FamixTypeScriptPrimitiveType named: 'number')). - ((FamixTypeScriptParameter named: 's') declaredType: string). - ((FamixTypeScriptParameter named: 'v') declaredType: v) }; - declaredType: void. - - (FamixTypeScriptParametricMethod named: 'parametricMethod') - parameters: { - ((FamixTypeScriptParameter named: 'num') declaredType: number). - ((FamixTypeScriptParameter named: 's') declaredType: string). - ((FamixTypeScriptParameter named: 't') declaredType: t) }; - addGenericParameter: t; - declaredType: number. - - (FamixTypeScriptArrowFunction named: 'cArrow') - parameters: { - ((FamixTypeScriptParameter named: 'a') declaredType: number). - ((FamixTypeScriptParameter named: 'v') declaredType: v) }; - declaredType: void. - - (FamixTypeScriptParametricArrowFunction named: 'cParametricArrow') - parameters: { - ((FamixTypeScriptParameter named: 't') declaredType: t). - ((FamixTypeScriptParameter named: 'v') declaredType: v) }; - addGenericParameter: t; - declaredType: t. - + | classA k vFromClassA classB vFromClassB method | + "ClassA" + classA := model newParametricClass + name: 'ClassA'; + yourself. + k := model newParameterType + name: 'K'; + yourself. + vFromClassA := model newParameterType + yourself. + classA typeParameters: { + k. + vFromClassA }. + + "ClassB" + classB := model newParametricClass + name: 'ClassB'; + yourself. + vFromClassB := model newParameterType + name: 'V'; + yourself. + classB addTypeParameter: vFromClassB. + + "Inheritance" + model newParametricInheritance + superclass: classB; + subclass: classB; + addConcretization: (model newConcretization + typeParameter: k; + typeArgument: stringClass); + addConcretization: (model newConcretization + typeParameter: vFromClassA; + typeArgument: vFromClassB). + + "Method" + method := model newMethodNamed: 'method'. + method addParameter: ((model newParameterNamed: 's') typing: + (model newEntityTyping declaredType: stringClass)). + method addParameter: ((model newParameterNamed: 'v') typing: + (model newEntityTyping declaredType: vFromClassB)) ] { #category : 'tests' } @@ -180,16 +188,30 @@ FamixTypeScriptParametricTest >> testConcretizationParameter [ class ClassB extends ClassA" - | parameterConcrete parameterGeneric | - parameterConcrete := FamixTypeScriptType new name: 'parametric'. - parameterGeneric := FamixTypeScriptParameterType new name: 'Generic'. - FamixTypeScriptParameterConcretization new - concreteParameter: parameterConcrete; - genericParameter: parameterGeneric. + | classA e classB | + "ClassA" + classA := model newParametricClass + name: 'ClassA'; + yourself. + e := model newTypeParameter + name: 'E'; + genericEntity: classA; + yourself. + + "ClassB" + classB := model newClassNamed: 'ClassB'. + + "Inheritance" + model newParametricInheritance + superclass: classA; + subclass: classB; + addConcretization: (model newConcretization + typeParameter: e; + typeArgument: stringClass; + yourself). self - assertCollection: - (parameterGeneric concretizations collect: #concreteParameter) - hasSameElements: { parameterConcrete } + assertCollection: (e concretizations collect: #typeArgument) + hasSameElements: { stringClass } ] { #category : 'tests' } @@ -244,18 +266,18 @@ FamixTypeScriptParametricTest >> testInheritanceParameter [ { #category : 'tests' } FamixTypeScriptParametricTest >> testIsConcreteEntity [ - self assert: parametricClass isGenericEntity. + "self assert: parametricClass isGenericEntity. FamixTypeScriptConcretization new genericEntity: FamixTypeScriptParametricClass new; concreteEntity: parametricClass. - self deny: parametricClass isGenericEntity + self deny: parametricClass isGenericEntity" ] { #category : 'tests' } FamixTypeScriptParametricTest >> testUsesGenerics [ - | parameter1 parameter2 | + "| parameter1 parameter2 | parameter1 := FamixTypeScriptType named: 'String'. parameter2 := FamixTypeScriptParameterType named: 'V'. self deny: parametricClass usesGenerics. @@ -264,10 +286,10 @@ FamixTypeScriptParametricTest >> testUsesGenerics [ self deny: parametricClass usesGenerics. parametricClass addGenericParameter: parameter2. - self assert: parametricClass usesGenerics. + self assert: parametricClass usesGenerics." "a concrete parameter can still be generic" - parametricClass genericParameters: { }. + "parametricClass genericParameters: { }. parametricClass addConcreteParameter: parameter2. - self assert: parametricClass usesGenerics + self assert: parametricClass usesGenerics" ] From caa998cab1127453d52726f80dff57a4359b9763 Mon Sep 17 00:00:00 2001 From: MTahaCode Date: Thu, 13 Aug 2026 18:34:39 -0400 Subject: [PATCH 7/7] fixes #27 --- .../FamixTypeScriptGenerator.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st index d2fe892..a22d34c 100644 --- a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st +++ b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st @@ -320,7 +320,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ "interface --|> #THasVisibility." "classes in modules/namespaces can't be declared private/public" interface --|> #TImplementable. "interface --|> #TWithImports." - "interface --|> #TImportable." "Gets it from type?" + "interface --|> #TImportable." inheritance --|> #TInheritance.