You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sniper mode printer needs to handle package reference , import x.y.z; and list of types of compilation unit.
It brings several requirements on compilation unit.
CtCompilationUnitImpl#declaredTypeRefs should be declared as @MetamodelPropertyField(DECLARED_TYPE_REF) ... including @PropertyGetter and @PropertySetter on interface and appropriate RoleHandler
CtCompilationUnitImpl#imports should be declared as @MetamodelPropertyField(DECLARED_IMPORT) ... including @PropertyGetter and @PropertySetter on interface and appropriate RoleHandler
CtCompilationUnitImpl#packageDeclaration should be declared as @MetamodelPropertyField(PACKAGE_DECLARATION) ... including @PropertyGetter and @PropertySetter on interface and appropriate RoleHandler
CtCompilationUnit should implement CtElement (which extends CtVisitable) and CtScanner should visit package reference, imports and all declared type references.
CtImport.getParent() should return instance of CompilationUnit (therefore it must extend CtElement)
Concept related to Spoon AST model CtCompilationUnit is not accessible from CtModel. It is not part of it's parent/child tree.
Each CtCompilationUnit is a root of own model, which has no parent, and has these children:
package reference
module reference
imports
references to included types.
WDYT? Do you see any problem? Drop here a note if you would have time to implement some part of that.
The text was updated successfully, but these errors were encountered:
`CompilationUnit` extends `SourcePositionHolder` now, so it can act as root of source fragments - as needed for sniper mode pretty printer as discussed in #2254.
CompilationUnit should implement CtElement is a big change, and kind of broke the tree representation of the AST. Honestly, I don't fully understand the impact that this change can have on existing clients.
But I think it is important.
It also solves an issue that we have with comments, such as license, that should be associated with the compilation unit and not really with a class.
This issue is related to #1785
Sniper mode printer needs to handle
package reference
,import x.y.z;
and list of types of compilation unit.It brings several requirements on compilation unit.
SourcePositionHolder
so it may act as root of the tree of source fragments (see review: feat: CompilationUnit extends SourcePositionHolder #2255)CtPackageDeclaration packageDeclaration
packageDeclaration
should holdSourcePosition
of the linepackage x.y.z;
. (see fix: CtPackageDeclaration position doesn't include top file comment #2811)CtCompilationUnitImpl#declaredTypeRefs
should be declared as @MetamodelPropertyField(DECLARED_TYPE_REF) ... including @PropertyGetter and @PropertySetter on interface and appropriateRoleHandler
CtCompilationUnitImpl#imports
should be declared as @MetamodelPropertyField(DECLARED_IMPORT) ... including @PropertyGetter and @PropertySetter on interface and appropriateRoleHandler
CtCompilationUnitImpl#packageDeclaration
should be declared as @MetamodelPropertyField(PACKAGE_DECLARATION) ... including @PropertyGetter and @PropertySetter on interface and appropriateRoleHandler
CtCompilationUnit
should implementCtElement
(which extends CtVisitable) andCtScanner
should visit package reference, imports and all declared type references.CtImport.getParent()
should return instance ofCompilationUnit
(therefore it must extendCtElement
)Concept related to Spoon AST model
CtCompilationUnit
is not accessible fromCtModel
. It is not part of it's parent/child tree.Each
CtCompilationUnit
is a root of own model, which has no parent, and has these children:WDYT? Do you see any problem? Drop here a note if you would have time to implement some part of that.
The text was updated successfully, but these errors were encountered: