SysML-v2-Pilot-Implementation icon indicating copy to clipboard operation
SysML-v2-Pilot-Implementation copied to clipboard

Unable Import Package Directly Under Root Accross .sysml Files With Short Name

Open westboros opened this issue 1 year ago • 2 comments

(Using 2024-05 Release) I am getting an error when trying to import a package in a separate .sysml file when using the package's short name, but only when that package is directly under the root node. In the example screenshot below, Package <b1> B1 in TestB.sysml is trying to import package <a1> A1 in TestA.sysml with statement "import a1;", but this results in the error "Couldn't resolve reference to Membership a1".

Note, I do not get an error when trying importing package <a1> A1 using its non-short name, A1. This can be seen with package <b2> B2 in TestB.sysml successfully importing package <a1> A1 with the statement "import A1;").

I also do not see this error when trying to import a package across .sysml files using the package's short name in the case when it is nested deeper into the .sysml file. This can be seen with package <b1> B1 in TestB.sysml successfully importing package <'a1.1'> A1.1 in TestA.sysml with the statement "import A1::'a1.1';".

image

westboros avatar Jul 12 '24 20:07 westboros

This is a known limitation of the Pilot Implementation. For performance reasons, top-level names across files in the global scope are resolved using the index built by Xtext during a project build. Currently, this index only includes the primary names of top-level elements and does not include short names or aliases.

We hope to remove this limitation in the coming months as we improve the name resolution algorithm.

seidewitz avatar Jul 15 '24 04:07 seidewitz

Thank you for the response and explanation. I was not aware it was a known issue. Is there some existing item that I can point to and close this as a duplicate? If the item cannot be accessed or referenced here, would it be appropriate to leave this open so that others know it is a known issue?

westboros avatar Jul 15 '24 14:07 westboros