]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/TextualModuleSource.java
New SCL completion implementation
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / source / TextualModuleSource.java
index 9a6f4c97fb07c33689e21885a1a641d4bdcadf01..e0d1c91e4da51e3b6b0b8d583b848857ae9a11b6 100644 (file)
@@ -69,7 +69,7 @@ public abstract class TextualModuleSource implements ModuleSource {
         }
     }
     
-    protected ImportDeclaration[] getBuiltinImports(UpdateListener listener) {
+    public ImportDeclaration[] getBuiltinImports(UpdateListener listener) {
         return DEFAULT_IMPORTS;
     }
     
@@ -93,11 +93,14 @@ public abstract class TextualModuleSource implements ModuleSource {
             if(compiler.getErrorLog().hasNoErrors())
                 return new Success<Module>(compiler.getModule());
             else {
-                LOGGER.error("While compiling " + getModuleName() + ":");
-                LOGGER.error(CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()));
+                if(options == null || !options.silent)
+                    LOGGER.error("While compiling " + getModuleName() + ":\n    " +
+                            CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()).replaceAll("\n", "\n    "));
                 return new Failure(compiler.getErrorLog().getErrors());
             }
         } catch (IOException e) {
+            if(options == null || !options.silent)
+                LOGGER.error("Compilation of module " + moduleName + " failed.", e);
             return new Failure(e);
         }
     }