]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/NamespaceOfModule.java
New SCL completion implementation
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / compilation / NamespaceOfModule.java
index c010835e9dc1383081033c8c28da0408dfef7f7f..4de6cac816477e79dfe9db5917fccbf4652b9a75 100644 (file)
@@ -1,11 +1,12 @@
 package org.simantics.scl.compiler.compilation;
 
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.function.Consumer;
 
+import org.simantics.scl.compiler.elaboration.chr.CHRRuleset;
 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
 import org.simantics.scl.compiler.elaboration.modules.TypeClass;
-import org.simantics.scl.compiler.elaboration.modules.TypeConstructor;
 import org.simantics.scl.compiler.elaboration.modules.TypeDescriptor;
 import org.simantics.scl.compiler.elaboration.relations.SCLEntityType;
 import org.simantics.scl.compiler.elaboration.relations.SCLRelation;
@@ -35,6 +36,11 @@ public class NamespaceOfModule implements Namespace {
     public Namespace getNamespace(String name) {
         return base.getNamespace(name);
     }
+    
+    @Override
+    public Collection<String> getNamespaces() {
+        return base.getNamespaces();
+    }
 
     @Override
     public SCLValue getValue(String name) throws AmbiguousNameException {
@@ -64,7 +70,7 @@ public class NamespaceOfModule implements Namespace {
             return base.getValue(name);
         }
     }
-
+    
     @Override
     public SCLRelation getRelation(String name) throws AmbiguousNameException {
         SCLRelation relation = module.getRelation(name);
@@ -73,6 +79,14 @@ public class NamespaceOfModule implements Namespace {
         return base.getRelation(name);
     }
 
+    @Override
+    public CHRRuleset getRuleset(String name) throws AmbiguousNameException {
+        CHRRuleset ruleset = module.getRuleset(name);
+        if(ruleset != null)
+            return ruleset;
+        return base.getRuleset(name);
+    }
+    
     @Override
     public SCLEntityType getEntityType(String name)
             throws AmbiguousNameException {