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

Unified Diff: lib/src/info.dart

Issue 1141013002: Fixes #179 -- compile error if editing files during server mode (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « lib/src/dependency_graph.dart ('k') | lib/src/report.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/info.dart
diff --git a/lib/src/info.dart b/lib/src/info.dart
index 2ddd34f835bb87edff940f6006a9bc212fb6b3d3..3db9e965f3f091cc0481db5ae31d882e4684b0f6 100644
--- a/lib/src/info.dart
+++ b/lib/src/info.dart
@@ -10,6 +10,7 @@ import 'dart:mirrors';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/error.dart' as analyzer;
import 'package:analyzer/src/generated/scanner.dart'
show Token, TokenType, SyntheticStringToken;
import 'package:logging/logging.dart' show Level;
@@ -730,3 +731,17 @@ final List<Type> infoTypes = () {
return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType))
..sort((t1, t2) => '$t1'.compareTo('$t2'));
}();
+
+class AnalyzerError extends Message {
+ factory AnalyzerError.from(analyzer.AnalysisError error) {
+ var severity = error.errorCode.type.severity;
+ var isError = severity == analyzer.ErrorSeverity.ERROR;
+ var level = isError ? Level.SEVERE : Level.WARNING;
+ int begin = error.offset;
+ int end = begin + error.length;
+ return new AnalyzerError(error.message, level, begin, end);
+ }
+
+ const AnalyzerError(String message, Level level, int begin, int end)
+ : super('[from analyzer]: $message', level, begin, end);
+}
« no previous file with comments | « lib/src/dependency_graph.dart ('k') | lib/src/report.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698