Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metamodel generation #31

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FamixTagTestAccess class >> annotation [
<FMClass: #Access super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
^ self
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FamixTagTestAttribute class >> annotation [
<FMClass: #Attribute super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
^ self
]
7 changes: 1 addition & 6 deletions src/Famix-Tagging-Tests-Entities/FamixTagTestClass.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@ FamixTagTestClass class >> annotation [
<FMClass: #Class super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
]

{ #category : #ambiguous }
FamixTagTestClass >> numberOfLinesOfCode: aNumber [
self cacheAt: #numberOfLinesOfCode put: aNumber
^ self
]
10 changes: 9 additions & 1 deletion src/Famix-Tagging-Tests-Entities/FamixTagTestEntity.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ FamixTagTestEntity class >> annotation [
<FMClass: #Entity super: #MooseEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
<abstract>
^ self
]

{ #category : #testing }
FamixTagTestEntity class >> isAbstract [

<generated>
^ self == FamixTagTestEntity
]

{ #category : #meta }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FamixTagTestInvocation class >> annotation [
<FMClass: #Invocation super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
^ self
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FamixTagTestMethod class >> annotation [
<FMClass: #Method super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
^ self
]
2 changes: 2 additions & 0 deletions src/Famix-Tagging-Tests-Entities/FamixTagTestModel.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Class {
#name : #FamixTagTestModel,
#superclass : #MooseModel,
#traits : 'FamixTagTestTEntityCreator',
#classTraits : 'FamixTagTestTEntityCreator classTrait',
#category : #'Famix-Tagging-Tests-Entities-Model'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FamixTagTestPackage class >> annotation [
<FMClass: #Package super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
^ self
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ FamixTagTestSourceTextAnchor class >> annotation [
<FMClass: #SourceTextAnchor super: #FamixTagTestEntity>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^self
^ self
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"
This trait is used by Famix models.
It provides an API for creating entities and adding them to the model.
"
Trait {
#name : #FamixTagTestTEntityCreator,
#category : #'Famix-Tagging-Tests-Entities-Model'
}

{ #category : #meta }
FamixTagTestTEntityCreator classSide >> annotation [

<FMClass: #TEntityCreator super: #Object>
<package: #'Famix-Tagging-Tests-Entities'>
<generated>
^ self
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newAccess [

<generated>
^ self add: FamixTagTestAccess new
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newAttribute [

<generated>
^ self add: FamixTagTestAttribute new
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newAttributeNamed: aName [

<generated>
^ self add: (FamixTagTestAttribute named: aName)
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newClass [

<generated>
^ self add: FamixTagTestClass new
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newClassNamed: aName [

<generated>
^ self add: (FamixTagTestClass named: aName)
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newInvocation [

<generated>
^ self add: FamixTagTestInvocation new
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newMethod [

<generated>
^ self add: FamixTagTestMethod new
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newMethodNamed: aName [

<generated>
^ self add: (FamixTagTestMethod named: aName)
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newPackage [

<generated>
^ self add: FamixTagTestPackage new
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newPackageNamed: aName [

<generated>
^ self add: (FamixTagTestPackage named: aName)
]

{ #category : #'entity creation' }
FamixTagTestTEntityCreator >> newSourceTextAnchor [

<generated>
^ self add: FamixTagTestSourceTextAnchor new
]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,41 +45,29 @@ FamixTagTestingGenerator >> defineClasses [
invocation := builder newClassNamed: #Invocation.
package := builder newClassNamed: #Package.

entity := builder newClassNamed: #Entity.
sourceTextAnchor := builder newClassNamed: #SourceTextAnchor.
]

{ #category : #definition }
FamixTagTestingGenerator >> defineHierarchy [

super defineHierarchy.

access --|> entity.
access --|> #TAccess.

attribute --|> entity.
attribute --|> #TAttribute.

class --|> entity.
class --|> #TClass.
class --|> #TSourceEntity.

invocation --|> entity.
invocation --|> #TInvocation.

method --|> entity.
method --|> #TMethod.
method --|> #TSourceEntity.

package --|> entity.
package --|> #TPackage.
package --|> #TWithTypes.
package --|> #TNamedEntity.

sourceTextAnchor --|> #THasImmediateSource
]

{ #category : #initialization }
FamixTagTestingGenerator >> initialize [
super initialize.
self notImportedFromFile
]