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

Unified Diff: pkg/analyzer/lib/error/error.dart

Issue 2498133002: Connect analyzer's AnalysisError object to front_end's CompilationError. (Closed)
Patch Set: Created 4 years, 1 month 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: pkg/analyzer/lib/error/error.dart
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 8a4f9e8e21cedaee417f8fe1261684e40950cdc1..59eb1c4c1ebf1e49909119450709d0168294b31f 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -13,8 +13,10 @@ import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
import 'package:analyzer/src/generated/source.dart';
+import 'package:front_end/compilation_error.dart';
import 'package:front_end/src/base/errors.dart';
import 'package:front_end/src/scanner/errors.dart';
+import 'package:source_span/src/span.dart';
export 'package:front_end/src/base/errors.dart'
show ErrorCode, ErrorSeverity, ErrorType;
@@ -642,7 +644,7 @@ ErrorCode errorCodeByUniqueName(String uniqueName) {
*
* See [AnalysisErrorListener].
*/
-class AnalysisError {
+class AnalysisError extends CompilationError {
/**
* An empty array of errors used when no errors are expected.
*/
@@ -750,6 +752,9 @@ class AnalysisError {
return hashCode;
}
+ @override
+ SourceSpan get span => source.sourceFile.span(offset, offset + length);
+
/**
* Return the message to be displayed for this error. The message should
* indicate what is wrong and why it is wrong.
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/source.dart » ('j') | pkg/analyzer/lib/src/generated/source_io.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698