Remove two underused methods from ResourceProviderMixin
Change-Id: I41f288f216e7db5a744d10a38074e104321e49f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
diff --git a/pkg/analysis_server/test/analysis_server_base.dart b/pkg/analysis_server/test/analysis_server_base.dart
index 0f9c58b..70541ef 100644
--- a/pkg/analysis_server/test/analysis_server_base.dart
+++ b/pkg/analysis_server/test/analysis_server_base.dart
@@ -276,12 +276,20 @@
);
}
+ /// Deletes the analysis options YAML file at [testPackageRootPath].
void deleteTestPackageAnalysisOptionsFile() {
- deleteAnalysisOptionsYamlFile(testPackageRootPath);
+ var path = join(testPackageRootPath, file_paths.analysisOptionsYaml);
+ deleteFile(path);
}
+ /// Deletes the `package_config.json` file at [testPackageRootPath].
void deleteTestPackageConfigJsonFile() {
- deletePackageConfigJsonFile(testPackageRootPath);
+ var filePath = join(
+ testPackageRootPath,
+ file_paths.dotDartTool,
+ file_paths.packageConfigJson,
+ );
+ deleteFile(filePath);
}
/// Returns the offset of [search] in [testFileContent].
diff --git a/pkg/analyzer_testing/api.txt b/pkg/analyzer_testing/api.txt
index 2d2c17a..a0eb688 100644
--- a/pkg/analyzer_testing/api.txt
+++ b/pkg/analyzer_testing/api.txt
@@ -29,10 +29,8 @@
pathContext (getter: Context)
resourceProvider (getter: ResourceProvider)
convertPath (method: String Function(String))
- deleteAnalysisOptionsYamlFile (method: void Function(String))
deleteFile (method: void Function(String))
deleteFolder (method: void Function(String))
- deletePackageConfigJsonFile (method: void Function(String))
fromUri (method: String Function(Uri))
getFile (method: File Function(String))
getFolder (method: Folder Function(String))
diff --git a/pkg/analyzer_testing/lib/resource_provider_mixin.dart b/pkg/analyzer_testing/lib/resource_provider_mixin.dart
index 3ee6b09..37fd80f 100644
--- a/pkg/analyzer_testing/lib/resource_provider_mixin.dart
+++ b/pkg/analyzer_testing/lib/resource_provider_mixin.dart
@@ -35,12 +35,6 @@
/// path context.
String convertPath(String filePath) => resourceProvider.convertPath(filePath);
- /// Deletes the analysis options YAML file at [directoryPath].
- void deleteAnalysisOptionsYamlFile(String directoryPath) {
- var path = join(directoryPath, file_paths.analysisOptionsYaml);
- deleteFile(path);
- }
-
/// Deletes the file at [path].
void deleteFile(String path) {
resourceProvider.getFile(convertPath(path)).delete();
@@ -51,16 +45,6 @@
resourceProvider.getFolder(convertPath(path)).delete();
}
- /// Deletes the `package_config.json` file at [directoryPath].
- void deletePackageConfigJsonFile(String directoryPath) {
- var path = join(
- directoryPath,
- file_paths.dotDartTool,
- file_paths.packageConfigJson,
- );
- deleteFile(path);
- }
-
/// Returns [uri] as a String.
String fromUri(Uri uri) {
return resourceProvider.pathContext.fromUri(uri);
diff --git a/pkg/linter/lib/src/rules/switch_on_type.dart b/pkg/linter/lib/src/rules/switch_on_type.dart
index 6070525..f87efde 100644
--- a/pkg/linter/lib/src/rules/switch_on_type.dart
+++ b/pkg/linter/lib/src/rules/switch_on_type.dart
@@ -23,9 +23,6 @@
DiagnosticCode get diagnosticCode => LinterLintCode.switch_on_type;
@override
- LintCode get lintCode => LinterLintCode.switch_on_type;
-
- @override
void registerNodeProcessors(
NodeLintRegistry registry,
LinterContext context,