Community
Participate
Working Groups
Build Identifier: M20100909-0800 Hi, when using the ImportURIScoping instead of namespaces, the elements exported by a referenced file are not updated correctly. You have to close both files and open them again so that the changes within the referenced file get visible to the origin file. I'm using Xtext 1.0.1 with Helios SR1 but it was the same for Xtext 1.0.0 and Eclipse 3.6.0. Thanks in advance! Reproducible: Always Steps to Reproduce: 1. Use ImportURIScoping 2. Open two files A and B, while A imports B 3. Add an element to B 4. Switch back to A and reference the new element 5. The changes are not visible to A and the new name is not found
Created attachment 180038 [details] Example Xtext projects
Created attachment 180039 [details] DSL file referencing another one
Created attachment 180040 [details] DSL file referenced by another one
import "platform:///resource/Test Models/models/b.mydsl" entity X { ref Y } it works on the first time because the default registered o.e.e.e.resource.impl.URIHandlerImpl can handle such an URI although it's not a valid platform URL (plaform:/ vs. platform:///).
The import uri validator should mark the illegal platform:/// ... uri. Does the user get feedback about the invalid format?
(In reply to comment #5) > The import uri validator should mark the illegal platform:/// ... uri. Does the > user get feedback about the invalid format? No, the ImportUriValidator accepts the /// URIs, too. That's why I didn't recognize the error in the first place.
This didn't make it into M4. Preliminary scheduled for M5.
As you have already mentioned the problem is that platform:///some/path... is not a platform URI, i.e. URI.isPlatform() returns false as there is an empty (not null) authority segment. Consequently and correctly, the PlatformResourceURIHandler does not feel responsible for this URI. EMF behaves consistently here. Unfortunately, the default URIHandlerImpl converts the URI to a URL and as Eclipse (not EMF) registered an PlatformURLHandler which is not as pedantic as EMF, this becomes a valid and openable URI :-( In Xtext, we have lots of places where we assume platform URIs to be canonical for good reasons. I see two viable options: 1) We adapt the URIConverter strip authority segments when normalize platform URIs (two or three slashes after the colon). 2) We change the EcoreUtil2.isValidURI to return false if an URI has the "platform" scheme but is not a platform URI. Pushed alternative 2 and a test to MASTER.
Closing all bugs that were set to RESOLVED before Neon.0