Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Type library not found with StadaloneSetup
Type library not found with StadaloneSetup [message #1836516] Wed, 06 January 2021 16:03 Go to next message
Yannick DAVELUY is currently offline Yannick DAVELUYFriend
Messages: 39
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
Re: Type library not found with StadaloneSetup [message #1836519 is a reply to message #1836516] Wed, 06 January 2021 16:36 Go to previous message
Yannick DAVELUY is currently offline Yannick DAVELUYFriend
Messages: 39
Registered: July 2020
Member
Resolved,

In the pom file the dependency on mydsl.core_library must be declared in <dependencies>

Yannick
Previous Topic:Full language inheritance
Next Topic:How to use a custom IAllContainersState
Goto Forum:
  


Current Time: Fri Apr 19 03:59:14 GMT 2024

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

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

Back to the top