]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Improved logic to find imports/includes in SCLTextEditorEnvironement"
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Fri, 29 Mar 2019 10:48:58 +0000 (10:48 +0000)
committerGerrit Code Review <gerrit2@simantics>
Fri, 29 Mar 2019 10:48:58 +0000 (10:48 +0000)
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sg/DiagramSceneGraphProvider.java
bundles/org.simantics.scl.runtime/scl/Prelude.md
bundles/org.simantics.scl.runtime/scl/Prelude.scl
bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java
bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java
bundles/org.simantics/src/org/simantics/SimanticsPlatform.java

index 6574b31b628bfbc735ba884415199c266b036a09..4ef9c6369c250bd873743ed929d99750b73bf37f 100644 (file)
@@ -189,7 +189,7 @@ public class DiagramSceneGraphProvider implements ICanvasSceneGraphProvider, IDi
                return new MappedElementCopyAdvisor(new ElementCopyAdvisor(), new ComponentCopyAdvisor());
     }
     
-    private void initContext(CanvasContext ctx) {
+    protected void initContext(CanvasContext ctx) {
         boolean unlock = false;
         if (!ctx.isLocked()) {
             ctx.setLocked(true);
index df91f29d1fae13da2e0aa7e46964fc5294979037..531a63587ac2635f6859d6ff84e2d7433ebf7102 100644 (file)
 ## Monads
 
 ::class[Monad]
-::value[>>]
+::value[>>, >=>]
 ::class[FunctorM]
 ::value[repeatForever]
 ::class[MonadZero]
 ::value[guard]
 ::class[MonadPlus, MonadOr]
 ::value[ignoreM]
+::class[MonadE]
+::value[compE]
+::class[MonadZeroE]
 
 # Side-effects 
 
index e92603becb8e4300db875532c2b87ba090b742e8..f983251093272d2168cb9eacc05db4542660afa0 100644 (file)
@@ -1096,6 +1096,7 @@ class (FunctorE f) => FunctorM f where
 /// MonadE ///
 
 class (FunctorE m, Monad m) => MonadE m where
+    "An effectful version of the bind operator `(>>=)`"
     bindE :: m a -> (a -> <e> m b) -> <e> m b
 
 instance MonadE Maybe where
@@ -1109,6 +1110,11 @@ instance MonadE (Either a) where
 instance MonadE [] where
     bindE l f = concatMap f l
 
+@inline
+"An effectful version of the Kleisli composition operator `(>=>)`"
+compE :: MonadE m => (a -> <e> m b) -> (b -> <f> m c) -> a -> <e,f> m c
+compE f g x = (f x) `bindE` g
+
 /// MZeroE ///
 
 class (MonadE m, MonadZero m) => MonadZeroE m where
index f590b5e0e82c6dc2dc1f798259c196c8d9178ba7..6f70bc56ee3a319edf5b703ff47e84eee580e9bf 100644 (file)
@@ -408,6 +408,7 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor {
 
             if (args.contains(SimanticsArguments.DO_NOT_SYNCHRONIZE_ONTOLOGIES)) {
                 requireSynchronize = false;
+                ontologyPolicy = OntologyRecoveryPolicy.Bypass;
             }
             
             if (args.contains(SimanticsArguments.DISABLE_INDEX)) {
index 50e8aada7b3f4cd3c14acdeee796427123db7dab..e69f9066994f62d7fe41c30400ef628a6db5284e 100644 (file)
@@ -221,6 +221,7 @@ public class SimanticsWorkbenchApplication implements IApplication, IExecutableE
                 SimanticsArguments.EXPERIMENT,
                 SimanticsArguments.DISABLE_INDEX,
                 SimanticsArguments.DATABASE_ID,
+                SimanticsArguments.DO_NOT_SYNCHRONIZE_ONTOLOGIES
         };
         IArguments result = Arguments.parse(args, accepted);
         return result;
index a4206e7da3e677a947a6b1db5e7033f547f32eaa..2504ba62d8f9ae04f4111bfbdaafa0086409d8f1 100644 (file)
@@ -153,7 +153,7 @@ public class SimanticsPlatform implements LifecycleListener {
      * It is applied when the ontology in the database of a workspace doesn't match
      * a newer ontology in the Eclipse workspace.
      */
-    public static enum OntologyRecoveryPolicy { ThrowError, Merge, ReinstallDatabase }
+    public static enum OntologyRecoveryPolicy { ThrowError, Merge, ReinstallDatabase, Bypass}
 
     /**
      * This policy dictates how the Simantics platform startup should react if
@@ -346,7 +346,7 @@ public class SimanticsPlatform implements LifecycleListener {
                 session.getService(XSupport.class).setServiceMode(true, true);
 
                 // Throw error
-                if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError) {
+                if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError || ontologyPolicy == OntologyRecoveryPolicy.Bypass) {
                     StringBuilder sb = new StringBuilder("The following graphs are not installed in the database: ");
                     if (!installTGs.isEmpty()) {
                         int i = 0;
@@ -367,8 +367,12 @@ public class SimanticsPlatform implements LifecycleListener {
                         sb.append(" Database/Platform Bundle version mismatch.\n");
                     }
                     sb.append("Hint: Use -fixErrors to install the graphs.");
-                    throw new PlatformException(sb.toString());
+                    if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError)
+                       throw new PlatformException(sb.toString());
+                    else
+                       log.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, sb.toString()));
                 }
+                
                 // Reinstall database
                 if (ontologyPolicy == OntologyRecoveryPolicy.ReinstallDatabase) {
                     log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Reinstalling the database."));