Closed barnettwilliam closed 6 months ago
Can you provide an example where this becomes a problem? What is the preferred resolution?
If parameters given in the Xtext action
"languageName": "uk.ac.kcl.inf.mdd6b.Turtles",
"baseName": "uk.ac.kcl.inf.mdd6b.turtles",
The recreated scope would be ../scoping/uk.ac.kcl.inf.mdd6b.TurtlesScopeProvider.xtend
Instead the last segment of languageName
should be used as shortName
which in this example it would be Turtles
So the solution would be to change
final String shortName = languageName.replace(baseName + ".", "");
to the more general
final String shortName = languageName.substring(languageName.lastIndexOf(".") + 1);
?
Yes
The paths the Xtext tool function uses when re-creating project files assumes that the
baseName
is a substring oflanguageName
https://github.com/mdenet/platformtools/blob/6d6644a4ece40940bcd2fb689144a3cf9ac49e9a/services/com.mde-network.ep.toolfunctions.xtext/src/main/java/com/mdenetnetwork/ep/toolfunctions/xtext/XtextTool.java#L73-L76
This doesn't have to be the case and if it isn't, the recreated file contains the the full langauageName including java the package.
pathName being a substring of languageName means the example Xtext project would contain duplicated names in the Xtext project package e.g. uk.ac.kcl.inf.mdd1.turtles.Turtles