|
Re: Resolving variables from an external source [message #1732104 is a reply to message #1732039] |
Thu, 12 May 2016 15:29 |
|
From what I've got from this description you would have to achieve the following:
The configUrl specifies an URI for an external resource. This resource has to be considered in the global scope. Therefore you would use the ImportUriGlobalScopeProvider. In order to make things not more complicated rename attribute "url" to "importURI", since this is what ImportUriResolver would try to find. Otherwise this would need to be customized also.
Next, the external resource has to be recognized as a resource which Xtext can handle. This needs the implementation of an IResourceServiceProvider. There is support for non-xtext resources in package org.eclipse.xtext.resource.generic. Have a look at the sources of plugin org.eclipse.xtext.ecore, which adds support for .ecore resources. For your use case, you would have to implement something similar for your external resource.
HTH,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
|
Re: Resolving variables from an external source [message #1732577 is a reply to message #1732575] |
Wed, 18 May 2016 10:57 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
Do you really want to cross-reference data you fetch live from the internet? Scoping, linking etc. are live services, i.e. they are called on user actions like keystrokes and should not have to deal with long running operations. Imagine content assist blocking because of a temporary internet problem...
Nevertheless, in order to refer to elements from non-Xtext based models, you have to register an implementation for the minimum infrastructure that Xtext needs. This is as Karsten pointed out mainly about index entries for the referable elements.
If you don't want to deep dive into the innards of Xtext, you could also build an Xtext grammar that is able to parse these files. I'd not be suprised if there already was an Xtext grammar for JSON.
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Powered by
FUDForum. Page generated in 0.06690 seconds