X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fscl%2FDocument%2FAll.scl;h=7781cfdb3ffaa9595eb322be7d01ffc286bf48c0;hb=refs%2Fchanges%2F23%2F523%2F2;hp=fa83a224acfc2d7076af4417e2f2e181680e93e7;hpb=06be67d1bdb9b335df8df6352d88c9cc6c78ea12;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.document.server/scl/Document/All.scl b/bundles/org.simantics.document.server/scl/Document/All.scl index fa83a224a..7781cfdb3 100644 --- a/bundles/org.simantics.document.server/scl/Document/All.scl +++ b/bundles/org.simantics.document.server/scl/Document/All.scl @@ -85,6 +85,9 @@ instance Coercible CommandContextMutable CommandContext where cloneCommandContext :: CommandContext -> CommandContextMutable cloneCommandContext context = merge (commandContext ()) context +instance Show CommandContext where + show ctx = printContext ctx + importJava "org.simantics.document.server.io.CommandResult" where data CommandResult @@ -143,10 +146,10 @@ displayValue var str = propertyValue (property var str) "HasDisplayValue" displayValue0 :: Variable -> String displayValue0 var = propertyValue var "HasDisplayValue" -consoleLog :: Variable -> String -> () -consoleLog state message = do - console = state#console - runProc $ addMessage console message +consoleLog :: CommandContext -> String -> () +consoleLog context message = match possibleValue context "console" with + Nothing -> () + Just console -> runProc $ addMessage console message contextDocument :: CommandContext -> IDocument contextDocument ctx = justValue ctx "__document__"