Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321615 - importURI is not 'very easy to use'
Summary: importURI is not 'very easy to use'
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Windows Vista
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 11:22 EDT by Ed Willink CLA
Modified: 2010-10-05 09:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.