-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP] Fixes multiple fixes for insertions in multi-file library #59853
Comments
Summary: |
I'm unsure if I should create yet another CP for beta in this case (my first CP). Thanks for your time! |
@bwilkerson WDYT? |
@FMorschel The prepared changelist for beta/stable (https://dart-review.googlesource.com/c/sdk/+/403380) does not appear to have the actual bug fix in it. (The path isn't being passed in and used.) @athomas Once the CL is correct, I think the change has significant value to developers working in libraries that have parts (though I don't know how many developers fall into that category) and very low risk. Most of the changes are in test code; the meaningful changes amount to three lines of code. |
Thanks @bwilkerson! Fixed that and rebased it. |
I'll do it for beta later then if you want me to. Thanks! |
As I was a bit confused by the issue template and the docs, I've opened https://dart-review.googlesource.com/c/sdk/+/403482 which adds the fix but is based on beta instead. If I should open a new issue, please let me know so I can do it properly. |
Both CLs look right to me. |
Fixes multiple insertions in multi-file library when using `dart fix`. Merges the test in https://dart-review.googlesource.com/c/sdk/+/401840 that is related to https://dart-review.googlesource.com/c/sdk/+/401180, but in the LSP handler where it can be more easily debugged. Bug #59572 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/401865 Cherry-pick-request: #59853 Change-Id: Ic0c42c4cacb5a270b1d92198819afa6813c83b17 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403380 Reviewed-by: Phil Quitslund <pquitslund@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com> Auto-Submit: Felipe Morschel <git@fmorschel.dev> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
How did the stable CL merge (and not the beta one which is weirder IMO) if this is still unapproved? |
Commit(s) to merge
https://dart-review.googlesource.com/c/sdk/+/401865
Target
Stable
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/403380
Issue Description
All platforms are affected.
The
dart fix
command applies insertions for all files in the library after #55520. This means that in a library with two files if we have errors on both and one of them has an insertion fix (say addingconst
), that insertion is added twice.The desired behaviour is to only do so for the current file since it runs for every file anyway. The initial issue was about detecting the fixes needed for part files but it didn't consider only fixing for a single file at a time, as it was doing previously.
What is the fix
The fix removes the loop for all units in the library and only runs for the unit with the current path.
Why cherry-pick
It creates errors in code fixes.
Risk
The risk of merging is low.
Issue link(s)
#59572
Extra Info
CC @pq
The text was updated successfully, but these errors were encountered: