-
Notifications
You must be signed in to change notification settings - Fork 441
FixItApplier: Misc improvements #3121
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
Conversation
@swift-ci please test |
|
||
// Drop any subsequent edits that conflict with one we just applied, and | ||
// adjust the range of the rest. | ||
while true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something or could this be a for loop like
for adjustmentEditIndex in editIndex..<edits.endIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for adjustmentEditIndex in (editIndex + 1)..<edits.endIndex
, yeah. Sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just remembered. I did this because it felt less safe to have 2 index variables in scope in the inner loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I crammed the increment into the while
condition but I don’t think you’re going to like this 😅
6d1fd86
to
bc79daf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could you add a short RFC post for the new API as described in https://github.com/swiftlang/swift-syntax/blob/main/Contributor%20Documentation/RFC%20Process.md?
Thank you, loved the feedback!
For the new parameter you mean? Even though |
Sorry, didn’t realize that |
Ah, to be fair, I did add a |
@swift-ci please test |
@swift-ci please test Windows |
swift package migrate
, this will enable us to prevent repeated fix-it application in various scenarios where multiple elements in a protocol composition type are diagnosed with the same insertion fix-it.