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

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

Issue 1861363002: Add hooks for changing priorities of warnings to errors in strong mode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/generated/error.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 138c20f1ca65f25962d436027c0acd3079ef6b70..5c86115ab089712b414835f91297f4be6458f30f 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -43,7 +43,14 @@ List<AnalysisError> doAnalysisError_listFromEngine(
.add(newAnalysisError_fromEngine(lineInfo, error, severity));
}
} else {
- serverErrors.add(newAnalysisError_fromEngine(lineInfo, error));
+ AnalysisError error2 = newAnalysisError_fromEngine(lineInfo, error);
+ bool isStrongMode = context.analysisOptions.strongMode;
+ if (isStrongMode &&
+ error is engine.StaticWarningCode &&
+ (error as engine.StaticWarningCode).isStrongModeError) {
+ error2.severity = AnalysisErrorSeverity.ERROR;
+ }
+ serverErrors.add(error2);
}
}
return serverErrors;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698