-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
For a repro create the following files:
lib/fix_data/foo.yaml
version: 1
transforms:
- title: 'Remove extra positional'
date: 2020-11-20
element:
uris: ['foo.dart']
method: 'foo'
inClass: 'Foo'
changes:
- kind: 'removeParameter'
index: 1lib/foo.dart
class Foo {
// This method used to have an extra `String b` parameter, that was removed.
void foo(int a) {}
}lib/bar.dart
import 'foo.dart';
void main() {
// 🔥 This line needs to get fixed to remove the "hello" argument.
Foo().foo(1, "hello");
}pubspec.yaml
name: dart_fix_repo
version: 1.2.3
environment:
sdk: '>=2.12.0 <3.0.0'Running dart analyze shows that there is an issue:
error • lib/bar.dart:4:15 • Too many positional arguments: 1 expected, but 2 found. Try removing the extra arguments. • extra_positional_arguments
However, dart fix says there's nothing to fix:
% dart fix --dry-run
Computing fixes in dart_fix_repo (dry run)... 0.5s
Nothing to fix!
The expectation is that this command would have changed the line above marked by 🔥 to be Foo().foo(1);, but it sadly doesn't do that.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug