Type library not found with StadaloneSetup [message #1836516] |
Wed, 06 January 2021 16:03  |
Yannick DAVELUY Messages: 36 Registered: July 2020 |
Member |
|
|
Hi,
I use a global scope provide that include a core library for my dsl.
It's inspired from https://zarnekow.blogspot.com/2012/11/xtext-corner-8-libraries-are-key.html
I implemented the GlobalScopeProvider this way:
public class XsmpGlobalScopeProvider extends DefaultGlobalScopeProvider {
@Inject
private Provider<LoadOnDemandResourceDescriptions> loadOnDemandDescriptions;
public static final URI PLUGIN_HEADER_URI = URI
.createURI("platform:/plugin/mydsl.core_library/model.corelibrary.myDsl");
@Override
protected IScope getScope(Resource resource, boolean ignoreCase, EClass type,
Predicate<IEObjectDescription> filter) {
final URI uri = resource.getURI();
final IResourceDescriptions result = getResourceDescriptions(resource);
final LoadOnDemandResourceDescriptions demandResourceDescriptions = loadOnDemandDescriptions.get();
demandResourceDescriptions.initialize(result, Collections.singleton(PLUGIN_HEADER_URI), resource);
final IScope scope = SelectableBasedScope.createScope(IScope.NULLSCOPE,
demandResourceDescriptions.getResourceDescription(PLUGIN_HEADER_URI), filter, type, ignoreCase);
return getScope(scope, resource, ignoreCase, type, filter);
}
}
This approach works very well with the eclipse editor : the core types are resolved without adding explicit dependencies.
I have now a problem when I try to build my projects with maven (standaloneSetup) : the resource for the core_library is not found.
How can I handle this case ?
Thanks
Yannick
|
|
|
|
Powered by
FUDForum. Page generated in 0.02038 seconds