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

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

Issue 2042883002: Add put/getSourceErrorsInLibrary to IncrementalCache. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixes for review comments. Created 4 years, 6 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 | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 9fb06c563b6c2893336d98d27a9ef6cd9e533403..633243af35e04f2098448e380f96d2cb98d81137 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -11,6 +11,7 @@ import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/source/error_processor.dart';
+import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode;
import 'package:analyzer/src/generated/generated/shared_messages.dart'
@@ -21,7 +22,6 @@ import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/task/model.dart';
import 'package:analyzer/task/model.dart';
import 'package:source_span/source_span.dart';
-import 'package:analyzer/src/dart/element/element.dart';
/**
* The descriptor used to associate error processors with analysis contexts in
@@ -123,6 +123,12 @@ class AnalysisError {
}
/**
+ * Initialize a newly created analysis error with given values.
+ */
+ AnalysisError.forValues(this.source, this.offset, this.length, this.errorCode,
+ this._message, this._correction);
+
+ /**
* Return the template used to create the correction to be displayed for this
* error, or `null` if there is no correction information for this error. The
* correction should indicate how the user can fix the error.
@@ -3023,6 +3029,11 @@ abstract class ErrorCode {
];
/**
+ * The lazy initialized map from [uniqueName] to the [ErrorCode] instance.
+ */
+ static HashMap<String, ErrorCode> _uniqueNameToCodeMap;
+
+ /**
* An empty list of error codes.
*/
static const List<ErrorCode> EMPTY_LIST = const <ErrorCode>[];
@@ -3070,6 +3081,20 @@ abstract class ErrorCode {
@override
String toString() => uniqueName;
+
+ /**
+ * Return the [ErrorCode] with the given [uniqueName], or `null` if not
+ * found.
+ */
+ static ErrorCode byUniqueName(String uniqueName) {
+ if (_uniqueNameToCodeMap == null) {
+ _uniqueNameToCodeMap = new HashMap<String, ErrorCode>();
+ for (ErrorCode errorCode in values) {
+ _uniqueNameToCodeMap[errorCode.uniqueName] = errorCode;
+ }
+ }
+ return _uniqueNameToCodeMap[uniqueName];
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698