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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 1513263002: Support optional package name arguments to --show-package-warnings (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 5 years 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 | « pkg/compiler/lib/src/commandline_options.dart ('k') | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index fa655c520b7376ada4a16be08621aef639a50638..8a0e00267cf7965ba9abd9131aa3dd03c88dbf03 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1664,7 +1664,7 @@ class _CompilerDiagnosticReporter extends DiagnosticReporter {
void reportDiagnosticInternal(DiagnosticMessage message,
List<DiagnosticMessage> infos,
api.Diagnostic kind) {
- if (!options.showPackageWarnings &&
+ if (!options.showAllPackageWarnings &&
message.spannable != NO_LOCATION_SPANNABLE) {
switch (kind) {
case api.Diagnostic.WARNING:
@@ -1672,6 +1672,10 @@ class _CompilerDiagnosticReporter extends DiagnosticReporter {
Element element = elementFromSpannable(message.spannable);
if (!compiler.inUserCode(element, assumeInUserCode: true)) {
Uri uri = compiler.getCanonicalUri(element);
+ if (options.showPackageWarningsFor(uri)) {
+ reportDiagnostic(message, infos, kind);
+ return;
+ }
SuppressionInfo info =
suppressedWarnings.putIfAbsent(uri, () => new SuppressionInfo());
if (kind == api.Diagnostic.WARNING) {
@@ -1932,7 +1936,7 @@ class _CompilerDiagnosticReporter extends DiagnosticReporter {
}
void reportSuppressedMessagesSummary() {
- if (!options.showPackageWarnings && !options.suppressWarnings) {
+ if (!options.showAllPackageWarnings && !options.suppressWarnings) {
suppressedWarnings.forEach((Uri uri, SuppressionInfo info) {
MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS;
if (info.warnings == 0) {
« no previous file with comments | « pkg/compiler/lib/src/commandline_options.dart ('k') | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698