When a metamodel generator includes a submetamodel that has a remote relation with yet another metamodel, then the related method is generated with the package: pragma from the parent generator's packageName as argument.
I believe this is wrong: it should behave as if the method was generated by its original generator, without the package: pragma.
For example:
FooMetamodelGenerator >> defineRelations [
foo - (self remoteTrait: #TMethod withPrefix: #Famix)
]
FooMetamodelGenerator class >> packageName [
^ #'Famix-Foo-Entities'
]
FooMetamodelGenerator generates this method:
method
<generated>
<FMProperty: #method type: #FamixTMethod opposite: #foo>
^ self attributeAt: #method ifAbsent: [ nil ]
Now create a new generator:
FooBarMetamodelGenerator class >> submetamodels [
^ { FooMetamodelGenerator }
]
FooBarMetamodelGenerator class >> packageName [
^ #'Famix-Foo-Bar-Entities'
]
And generating with it modifies the previous method by adding the package: pragma:
method
<generated>
<FMProperty: #method type: #FamixTMethod opposite: #foo>
<package: #'Famix-Foo-Bar-Entities'>
^ self attributeAt: #method ifAbsent: [ nil ]
There is a live example in Famix-OpenTelemetry: load the value baseline and try generating with both FamixOpenTelemetryGenerator and FamixOpenTelemetryValueGenerator. Then we can see that the Span>>origin method has this issue.
When a metamodel generator includes a submetamodel that has a remote relation with yet another metamodel, then the related method is generated with the
package:pragma from the parent generator'spackageNameas argument.I believe this is wrong: it should behave as if the method was generated by its original generator, without the
package:pragma.For example:
FooMetamodelGenerator generates this method:
Now create a new generator:
And generating with it modifies the previous method by adding the
package:pragma:There is a live example in Famix-OpenTelemetry: load the
valuebaseline and try generating with bothFamixOpenTelemetryGeneratorandFamixOpenTelemetryValueGenerator. Then we can see that theSpan>>originmethod has this issue.