Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Also introduces new `ServiceMethod` helper class to build AQL service call expre
- https://github.com/eclipse-syson/syson/issues/1621[#1621] [diagrams] Fix an issue where the creation of a _Package_ inside another _Package_ created the _Package_ at the root of the diagram in addition to the inside of the target _Package_.
- https://github.com/eclipse-syson/syson/issues/1617[#1617] [import] Fix incorrect resolution of _redefined feature_ on `Redefinitions` during textual import.
- https://github.com/eclipse-syson/syson/issues/1627[#1627] [import] [export] Fix invalid textual import/export of `LiteralRational`.
- https://github.com/eclipse-syson/syson/issues/1634[#1634] [export] Redefining an `AttributeUsage` with a _shortName_ does not properly export to the textual format.

=== Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,29 @@ public void checkFeatureReferenceExpressionWithQualifiedNameDeresolution() throw
this.checker.check(input, input);
}

@Test
@DisplayName("GIVEN a model with an attribute redefining an attribute with a short name, WHEN importing and exporting the model, THEN the redefined attribute should not redefine the shortName")
public void checkRedefineAttributeWithShortName() throws IOException {
var input = """
part p {
attribute <a> anAttribute;
}

part p1 :> p {
attribute :>> a;
}""";
var expected = """
part p {
attribute <a> anAttribute;
}
part p1 :> p {
attribute :>> anAttribute;
}""";

this.checker.check(input, expected);
}


@Test
@DisplayName("GIVEN a model with an AttributeUsage containing a LiteralString, WHEN importing and exporting the model, THEN the exported text file should be the same as the imported one.")
public void checkLiteralString() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ private String buildImportContextRelativeQualifiedName(Element element, Element
}

private String appendNameWithShortName(Appender builder, Element element) {
String shortName = element.getShortName();
String shortName = element.getDeclaredShortName();
Comment thread
AxelRICHARD marked this conversation as resolved.
if (!this.isNullOrEmpty(shortName)) {
builder.appendSpaceIfNeeded().append("<").appendPrintableName(shortName).append(">");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ metadata def MP :> SemanticMetadata {
}
```

- Fix an issue during import and export of rational numbers.
- Fix an issue during texual import and export of rational numbers.

The following model is now properly imported:

```
Expand Down Expand Up @@ -99,6 +100,41 @@ package Occurrences {
}
```

- Fix an issue where a model with a redefining `AttributeUsage` incorrectly redefined a _short name_ during a textual export.
For example with the following model:

```
part p {
attribute <a> anAttribute;
}

part p1 :> p {
attribute :>> anAttribute;
}
```

The export gave :

```
part p {
attribute <a> anAttribute;
}
part p1 :> p {
attribute <a> :>> anAttribute;
}
```

Instead, it now exports:

```
part p {
attribute <a> anAttribute;
}
part p1 :> p {
attribute :>> anAttribute;
}
```

== Improvements

- In diagrams, when using direct edit on graphical elements, it's now possible to use _short names_ in the qualified names.
Expand Down
Loading