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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 1774913006: Add error codes to server protocol (#25958). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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: pkg/analysis_server/lib/src/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 822727cc13c111c7f9961cb2459c251e51585683..00f749e5a00d61d9bc6b7478ea955207c1eebdb2 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -111,16 +111,17 @@ AnalysisError newAnalysisError_fromEngine(
location = new Location(file, offset, length, startLine, startColumn);
}
- // Deafult to the error's severity if none is specified.
+ // Default to the error's severity if none is specified.
errorSeverity ??= errorCode.errorSeverity;
// done
var severity = new AnalysisErrorSeverity(errorSeverity.name);
var type = new AnalysisErrorType(errorCode.type.name);
String message = error.message;
+ String code = errorCode.name.toLowerCase();
String correction = error.correction;
bool fix = hasFix(error.errorCode);
- return new AnalysisError(severity, type, location, message,
+ return new AnalysisError(severity, type, location, message, code,
correction: correction, hasFix: fix);
}

Powered by Google App Engine
This is Rietveld 408576698