Description
dart-archive/linter#3361 added support in the linter to detect local functions for which the name begins with an underscore.
However, as far as I can tell, analysis_server...remove_leading_underscore.dart was never updated to provide a fix for this.
dart --version
: Dart SDK version: 3.0.5 (stable) (Mon Jun 12 18:31:49 2023 +0000) on "macos_arm64"
I will be submitting an MR with a test shortly.
I'd planned to also develop a fix, but I can't seem to build anything due to a missing ../../third_party/pkg/yaml_edit
dependency for analysis_server
.
I'll also inline here the test I am adding to pkg/analysis_server/test/src/services/correction/fix/remove_leading_underscore_test.dart
Future<void> test_localFunction() async {
await resolveTestCode(r'''
void f() {
int _foo() => 1;
print(_foo());
}
''');
await assertHasFix('''
void f() {
int foo() => 1;
print(foo());
}
''');
}
I'm willing to develop a fix if I can receive some guidance on fixing the missing yaml_edit
dependency.