Skip to content

Commit

Permalink
Add TReferenced trait to Reference, generate entities
Browse files Browse the repository at this point in the history
  • Loading branch information
fuhrmanator committed Aug 1, 2024
1 parent 9ef30ce commit eeb4620
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ FamixTypeScriptEntity >> isQueryable [
^ false
]

{ #category : #testing }
FamixTypeScriptEntity >> isReference [

<generated>
^ false
]

{ #category : #testing }
FamixTypeScriptEntity >> isStructuralEntity [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ FamixTypeScriptImportingContext >> importProperty [
FamixTypeScriptImportingContext >> importReference [

<generated>
^ self importConcreteEntity: (self class fm3ClassNamed: #Reference)
^ self importAssociation: (self class fm3ClassNamed: #Reference)
]

{ #category : #importing }
Expand Down
32 changes: 32 additions & 0 deletions src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
"
## Relations
======================
### Association source
| Relation | Origin | Opposite | Type | Comment |
|---|
| `referencer` | `FamixTReference` | `outgoingReferences` | `FamixTWithReferences` | Source entity making the reference. from-side of the association|
### Association target
| Relation | Origin | Opposite | Type | Comment |
|---|
| `referredType` | `FamixTReference` | `incomingReferences` | `FamixTReferenceable` | Target entity referenced. to-side of the association|
### 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|
## 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.|
"
Class {
#name : #FamixTypeScriptReference,
#superclass : #FamixTypeScriptEntity,
#traits : 'FamixTReference',
#classTraits : 'FamixTReference classTrait',
#category : #'Famix-TypeScript-Entities-Entities'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ FamixTypeScriptGenerator >> defineHierarchy [

primitiveType --|> type.
primitiveType --|> #TPrimitiveType.

reference --|> #TReference.

sourcedEntity --|> #TWithComments.

Expand Down

0 comments on commit eeb4620

Please sign in to comment.