From: Hannu Niemistö Date: Thu, 28 Feb 2019 13:22:43 +0000 (+0200) Subject: Don't list warnings in console when module import fails X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=97f45e9a3ae331ef93550f0163777a79d6dd1b89;p=simantics%2Fplatform.git Don't list warnings in console when module import fails Change-Id: I54832d5c530f173665c632493403963dda80e2ea (cherry picked from commit 036b555cbdd43f284be4818de93f11fdddf6d9f2) --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/commands/CommandSession.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/commands/CommandSession.java index 46cd0cb45..d0e44a9c7 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/commands/CommandSession.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/commands/CommandSession.java @@ -32,6 +32,7 @@ import org.simantics.scl.compiler.environment.Environment; import org.simantics.scl.compiler.environment.LocalEnvironment; import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification; import org.simantics.scl.compiler.errors.CompilationError; +import org.simantics.scl.compiler.errors.ErrorSeverity; import org.simantics.scl.compiler.errors.Locations; import org.simantics.scl.compiler.internal.codegen.utils.NameMangling; import org.simantics.scl.compiler.internal.parsing.exceptions.SCLSyntaxErrorException; @@ -123,7 +124,8 @@ public class CommandSession { defaultHandler.printError(failure.toString()); if(failure.reason instanceof CompilationError[]) for(CompilationError error : (CompilationError[])failure.reason) { - defaultHandler.printError(" " + error.description); + if(error.severity != ErrorSeverity.WARNING) + defaultHandler.printError(" " + error.description); } } for(CommandSessionImportEntry entry : importEntries) @@ -657,7 +659,7 @@ public class CommandSession { formatException(handler, e); } } - + public static CompilationError[] validate(ModuleRepository moduleRepository,StringReader commandReader) { CommandSession session = new CommandSession(moduleRepository, null); return session.validate(commandReader);