Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resolve xtextLink
Resolve xtextLink [message #1702698] Fri, 24 July 2015 08:08 Go to next message
Sascha Petersen is currently offline Sascha PetersenFriend
Messages: 1
Registered: July 2015
Junior Member
Hello,
I have a problem to resolve a JVM-Type while using the Standalonesetup.
I used xtext 2.4.3.

In my DSL i using the follow:
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types
WidgetType:
	"widgettype" name=ID "mapsto" mappedType=JavaType;
JavaType:
	{JavaType}
	type=[types::JvmDeclaredType|QualifiedName]
	( (array?="[]") | ("<" (params+=JavaType) ("," params+=JavaType)* ">"))?;

Scoping and using quickreference in the editor works well, but if i used with the Stanalone setup the mappedTyped looks like:
JvmAnnotationType:  (eProxyURI: platform:/resource/test-project/src/java/de/test/test.mydsl#xtextLink_::0.1.0.1::0::/1


The code for loading the model with StandaloneSetup:
Injector injector = new MyDSLStandaloneSetup().createInjectorAndDoEMFRegistration();
				XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
				resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
				resourceSet.getPackageRegistry().put(MyDSLPackage.eNS_URI, MyDSLPackage.eINSTANCE);
				resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
MyDSLPackage.eNAME, new XMIResourceFactoryImpl());
				resourceSet.getPackageRegistry().put(TypesPackage.eNS_URI, TypesPackage.eINSTANCE);
URI uri = URI.createPlatformResourceURI(mappingImport.getImportURI(),  true);
Resource resource = resourceSet.getResource(uri, true);
resource.load(Collections.EMPTY_MAP);


Where is my mistake?
Re: Resolve xtextLink [message #1702746 is a reply to message #1702698] Fri, 24 July 2015 12:38 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
it seems you miss a resourceSet.setClasspathUriContext(this) asuming the Java stuff is on the classpath of (this)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[Formatter2] annoying line break
Next Topic:How to align text elements of more lines
Goto Forum:
  


Current Time: Tue Mar 19 09:01:35 GMT 2024

Powered by FUDForum. Page generated in 0.01883 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top