-
Notifications
You must be signed in to change notification settings - Fork 69
[1887] Export fails to escape some names when using qualified name #1889
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
base: cooldown
Are you sure you want to change the base?
Conversation
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
Bug: eclipse-syson#1694 Signed-off-by: Gwendal Daniel <gwendal.daniel@obeosoft.com>
Bug: eclipse-syson#1847 Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
19651c2 to
f4a4835
Compare
Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr> Bug: eclipse-syson#1887
| // Need relative qualified name | ||
| assertEquals("p3::Part1", this.getDeresolvedName(part1Def, part1Usage)); | ||
| // Need qualified name cause name conflict | ||
| assertEquals("Root::p3::Part1", this.getDeresolvedName(part1Def, part1Usage)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a strange modification, and does not correspond to the associated comment just above.
| // located in p1_1 whereas we are targeting RootPackage::p1::x3 | ||
| this.directEditInitialLabelTester.checkDirectEditInitialLabelOnNode(this.verifier, this.diagram, GeneralViewItemAndAttributeProjectData.GraphicalIds.P1_1_X1_ID, | ||
| "x1 = p1::x3 / p1::x3 * 10"); | ||
| "x1 = RootPackage::p1::x3 / RootPackage::p1::x3 * 10"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems strange, why the fix of escaped qualified names would modified this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I totally prune the computation branch that tryied to compute a shorter qualified name.
This was this branch of code that caused the issue. As a first attempt I only fixed the "name" escape but short after a another issue was raised caused by the same branch. The problem appears with nested element with similiar name.
With the following model in memory:
package root {
package p1 {
part p1 {
part p2 =p3; // Pointing to V2
}
part p3 {
/* V1*/
}
part p3 {
/* V2*/
}
}
}
The export would give:
package root {
package p1 {
part p1 {
part p2 = p1::p3;
}
part p3 {
/* V1 */
}
part p3 {
/* V2 */
}
}
}
Wich is incorect because the "p1" in the qualified name is resolved against le "part p1" and not "package p1" following SysML resolving process.
This all branch was trying to improve the handling of name conflict but it causes more issues...
As it is a degraded model state (invalid name conflict) I finally implented a more simple (less error prone) approach. Use the full qualified name when there is name conflit.
This is the explaination for the different test result. In case of name conflict, use the full qualified name.
|
could you please auto-review your PR as asked by the PR template? |
PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW
Auto review
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,type:)Changelog and release notes
CHANGELOG.adoc+doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adocbeen updated to reference the relevant issues?CHANGELOG.adoc?CHANGELOG.adoc?doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Key highlightssection indoc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Documentation
Tests