Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321615

Summary: importURI is not 'very easy to use'
Product: [Modeling] TMF Reporter: Ed Willink <ed>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 CC: Holger.Schill, sebastian.zarnekow
Version: 1.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2010-08-03 11:22:14 EDT
The use of a naming convention for importURI may have seemed like a good idea but unfortunately it fails to provide complete functionality and inhibits editor assistance.

I migrated from, 'importedNamespace' to 'importedURI'. Oops wrong spelling; no help. Once I find the mistake and correct global bindings, it loads but it does not work as a reference.

If import URI was signalled by a URI type for the reference 'identifier' rather than a special spelling of the target feature as in: 

terminal NON_FRAGMENT_URI returns ecoreUtils::URI : ...;
terminal FRAGMENT_URI returns ecoreUtils::URI : ...;

importURIatRoot=[MyResource|NON_FRAGMENT_URI]
importURIofFragment=[MyElement|FRAGMENT_URI]

the meta-model would have a resolved reference, importURI would not be a special spelling, and the generator could provide plausible default bindings.
Comment 1 Holger Schill CLA 2010-08-04 03:15:23 EDT
There is a possibility to customize the convention for each dsl in the corresponding RuntimeModule to e.g. "namespace".

	@Override
	public void configure(Binder binder) {
		super.configure(binder);
 binder.bindConstant().annotatedWith(Names.named(ImportUriResolver.IMPORT_URI_FEATURE)).to("namespace");
	}

Of course it does not solve the problem that the Grammar / Metamodel has to follow conventions but you can introduce your own one.