[messages] Remove unnecessary uniqueName logic in IgnoreValidator.
Removes logic from the `IgnoreValidator` class that was attempting to
handle `DiagnosticCode.uniqueName` when reporting unnecessary ignore
comments. This logic was unnecessary, because `ignore` comments don't
work on diagnostic code unique names; they only work on diagnostic
code shared names (see
https://dart-review.googlesource.com/c/sdk/+/462864 for details).
Change-Id: I6a6a69640af3cf743f8f431a58c20e9adbaf2342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/analyzer/lib/src/error/ignore_validator.dart b/pkg/analyzer/lib/src/error/ignore_validator.dart
index 52d0bc7..fd81b6f 100644
--- a/pkg/analyzer/lib/src/error/ignore_validator.dart
+++ b/pkg/analyzer/lib/src/error/ignore_validator.dart
@@ -132,10 +132,8 @@
var ignoredOnLine = ignoredOnLineMap[lineNumber];
ignoredForFile.removeByName(error.ignoreName);
- ignoredForFile.removeByName(error.ignoreUniqueName);
ignoredOnLine?.removeByName(error.ignoreName);
- ignoredOnLine?.removeByName(error.ignoreUniqueName);
}
//
// Report any remaining ignored names as being unnecessary.
@@ -288,15 +286,6 @@
extension on Diagnostic {
String get ignoreName => diagnosticCode.name.toLowerCase();
-
- String get ignoreUniqueName {
- String uniqueName = diagnosticCode.uniqueName;
- int period = uniqueName.indexOf('.');
- if (period >= 0) {
- uniqueName = uniqueName.substring(period + 1);
- }
- return uniqueName.toLowerCase();
- }
}
extension on List<IgnoredElement> {