From 036b555cbdd43f284be4818de93f11fdddf6d9f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Thu, 28 Feb 2019 15:22:43 +0200 Subject: [PATCH] Don't list warnings in console when module import fails Change-Id: I54832d5c530f173665c632493403963dda80e2ea --- .../org/simantics/scl/compiler/commands/CommandSession.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.47.1