Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 21, 2018

At long last, fixes #20315

This was harder than the others because importFixes was written as a tree of function calls with CodeFixActions being created at the bottom of that tree, while in the middle of determining what fixes to do. That's a problem because for code-fix-all we don't want to get a CodeFixAction, we want information about one of many imports that we're adding. (We can't just combine the text changes independently, or else we'd add 5 import statements instead of an import with 5 imported names.)

So, this PR refactors it to return a ImportFix, which can be converted into a CodeFixAction, or can be added to a collection of new imports that are then added as a group.

@ghost ghost force-pushed the importFixAll branch from 92ca3a9 to ef7a8ed Compare June 21, 2018 21:22
@ghost ghost requested a review from amcasey June 21, 2018 21:22
"category": "Message",
"code": 95060
},
"Fix all missing imports": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about Add all missing imports instead.

@ghost
Copy link
Author

ghost commented Jul 3, 2018

@mhegazy @amcasey Please re-review

@ghost ghost merged commit 064ecd4 into master Jul 3, 2018
@ghost ghost deleted the importFixAll branch July 3, 2018 22:19
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix all in file for import fix

1 participant