Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/compiler/LoggingDartCompilerListener.java

Issue 8395013: DartC User Warning Framework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use new ErrorCode enums in single onError() method. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/compiler/LoggingDartCompilerListener.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/compiler/LoggingDartCompilerListener.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/compiler/LoggingDartCompilerListener.java
index e2896b5526fc64751fff4d6ec95105e7383c9e3d..10a3da7664f3ecf3486ccb460698cd591a95da03 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/compiler/LoggingDartCompilerListener.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/compiler/LoggingDartCompilerListener.java
@@ -15,6 +15,8 @@ package com.google.dart.tools.core.internal.compiler;
import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompilerListener;
+import com.google.dart.compiler.ErrorSeverity;
+import com.google.dart.compiler.SubSystem;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.tools.core.DartCore;
@@ -26,20 +28,18 @@ public class LoggingDartCompilerListener extends DartCompilerListener {
* A compiler listener that can be shared.
*/
public static final LoggingDartCompilerListener INSTANCE = new LoggingDartCompilerListener();
-
- @Override
- public void compilationError(DartCompilationError event) {
- DartCore.logError("Compilation error: " + event);
- }
-
- @Override
- public void compilationWarning(DartCompilationError event) {
- DartCore.logError("Compilation warning: " + event);
- }
-
+
@Override
- public void typeError(DartCompilationError event) {
- DartCore.logError("Type error: " + event);
+ public void onError(DartCompilationError event) {
+ if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.ERROR) {
+ DartCore.logError("Compilation error: " + event);
+ }
+ if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) {
+ DartCore.logError("Compilation warning: " + event);
+ }
+ if (event.getErrorCode().getSubSystem() == SubSystem.STATIC_TYPE) {
+ DartCore.logError("Type error: " + event);
+ }
}
@Override

Powered by Google App Engine
This is Rietveld 408576698