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

Unified Diff: lib/src/info.dart

Issue 988483006: Add widget to display errors, and report dependency_graph errors correctly (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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: lib/src/info.dart
diff --git a/lib/src/info.dart b/lib/src/info.dart
index 3d7c8cfad95688505f9fa025ce66b2ec42952fa0..80413fdad92524f3a2bd3aab992a2d3b0afc0139 100644
--- a/lib/src/info.dart
+++ b/lib/src/info.dart
@@ -17,6 +17,8 @@ import 'package:logging/logging.dart' show Level;
import 'package:dev_compiler/src/checker/rules.dart';
import 'package:dev_compiler/src/utils.dart' as utils;
+import 'report.dart' show Message;
+
/// Represents a summary of the results collected by running the program
/// checker.
class CheckerResults {
@@ -114,22 +116,23 @@ class CoercionError extends Coercion {
CoercionError() : super(null, null);
}
-abstract class StaticInfo {
+abstract class StaticInfo implements Message {
/// AST Node this info is attached to.
// TODO(jmesserly): this is somewhat redundant with SemanticNode.
AstNode get node;
- /// Log level for error messages. This is a placeholder
- /// for severity.
- Level get level;
+ @override
+ int get begin => node is AnnotatedNode
+ ? (node as AnnotatedNode).firstTokenAfterCommentAndMetadata.offset
+ : node.offset;
- /// Description / error message.
- String get message;
+ @override
+ int get end => node.end;
}
/// Implicitly injected expression conversion.
// TODO(jmesserly): rename to have Expression suffix?
-abstract class Conversion extends Expression implements StaticInfo {
+abstract class Conversion extends Expression with StaticInfo {
final TypeRules rules;
// TODO(jmesserly): should probably rename this "operand" for consistency with

Powered by Google App Engine
This is Rietveld 408576698