I used parent_element.heritage.insert(0,syside.FeatureTyping,metadata1) with parent_element as a MetadataUsage and this produces a metadata keyword like this:
@metadataDefs::metadata1;
how can I get the shortname of the metadata as a keyword dirctly?
Programmatic reference printing is currently limited, it only shortens inherited references. We will extend it to support imports as well but cannot promise when. In that case you would need to add a namespace import as <ancestor>.children.insert(0, syside.NamespaceImport, metadataDefs) in one of the ancestor namespaces.
I also want to redefine an attribute from a namespace import. In the textual syntax it shows a βrefβ instead of β:>>β. Is this related to the namespace import issue or is there a solution for it?
ref keyword is for referential usages which is modified through <usage>.is_reference property (opposite of is_composite property). Otherwise reference printing behaviour is the same.
The output is :>> redefined_attribute , but for an attribute from a namespace import i get ref redefined_attribute. How can I create a redefinition from an imported attribute?