Uli Merkel's Profile

GitHub User: UliMerkel

Site: www.uli-merkel.de

Comments by Uli Merkel


this is an example to limit scope to the active DSL file only
(based on the standard XTEXT project)
with a lot of help from the forum:
"reducing cross reference to current DSL file" http://www.eclipse.org/forums/index.php/t/635607/

Greetings from Frankfurt/Germany

P.S. @Boris: your screencasts are a great support for XTEXT newbies like me

// ##### our new ScopeProvider (NullGlobalScopeProvider.java)
package org.xtext.example.mydsl;

import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.resource.IEObjectDescription;
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
import org.eclipse.xtext.scoping.IScope;
import com.google.common.base.Predicate;

public class NullGlobalScopeProvider implements IGlobalScopeProvider {

  public IScope getScope(Resource context, EReference reference,
                Predicate<IEObjectDescription> filter) {
    return IScope.NULLSCOPE;
// ##### binding it in MyDslRuntimeModule.java
package org.xtext.example.mydsl;

import org.eclipse.xtext.scoping.IGlobalScopeProvider;

public class MyDslRuntimeModule 
  extends org.xtext.example.mydsl.AbstractMyDslRuntimeModule {
  public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
    return NullGlobalScopeProvider.class;