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

Unified Diff: pkg/analysis_server/lib/src/computer/error.dart

Issue 492243002: Introduce convenience methods into generated analysis server classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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: pkg/analysis_server/lib/src/computer/error.dart
diff --git a/pkg/analysis_server/lib/src/computer/error.dart b/pkg/analysis_server/lib/src/computer/error.dart
index 8fcf6d26dab37f1940c1f4ec763a82ffd2a755a1..59dbdbd960d6b14acc3fabc5241b51b609a13abd 100644
--- a/pkg/analysis_server/lib/src/computer/error.dart
+++ b/pkg/analysis_server/lib/src/computer/error.dart
@@ -24,36 +24,6 @@ List<Map<String, Object>> engineErrorInfoToJson(engine.AnalysisErrorInfo info) {
List<Map<String, Object>> engineErrorsToJson(engine.LineInfo lineInfo,
List<engine.AnalysisError> errors) {
return errors.map((engine.AnalysisError error) {
- return analysisErrorFromEngine(lineInfo, error).toJson();
+ return new AnalysisError.fromEngine(lineInfo, error).toJson();
}).toList();
}
-
-
-AnalysisError analysisErrorFromEngine(engine.LineInfo lineInfo,
- engine.AnalysisError error) {
- engine.ErrorCode errorCode = error.errorCode;
- // prepare location
- Location location;
- {
- String file = error.source.fullName;
- int offset = error.offset;
- int length = error.length;
- int startLine = -1;
- int startColumn = -1;
- if (lineInfo != null) {
- engine.LineInfo_Location lineLocation = lineInfo.getLocation(offset);
- if (lineLocation != null) {
- startLine = lineLocation.lineNumber;
- startColumn = lineLocation.columnNumber;
- }
- }
- location = new Location(file, offset, length, startLine, startColumn);
- }
- // done
- var severity = new ErrorSeverity(errorCode.errorSeverity.name);
- var type = new ErrorType(errorCode.type.name);
- String message = error.message;
- String correction = error.correction;
- return new AnalysisError(severity, type, location, message,
- correction: correction);
-}
« no previous file with comments | « pkg/analysis_server/lib/src/computer/element.dart ('k') | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698