Skip to content

Allow inferFromUsage to do auto-imports #33915

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

Merged
merged 7 commits into from
Oct 14, 2019

Conversation

andrewbranch
Copy link
Member

Fixes #32910

@andrewbranch andrewbranch requested a review from sandersn October 9, 2019 23:52
if (action.codeAction.changes.length && changes.tryInsertTypeAnnotation(sourceFile, declaration, createTypeReferenceNode(typeNode.qualifier, typeNode.typeArguments))) {
for (const change of action.codeAction.changes) {
const file = sourceFile.fileName === change.fileName ? sourceFile : Debug.assertDefined(program.getSourceFile(change.fileName));
changes.pushRaw(file, change);
Copy link
Member

Choose a reason for hiding this comment

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

Is this the first codefix to run another codefix and merge its actions? Seems like something that would have a common utility inside the codefox folder.

Copy link
Member Author

Choose a reason for hiding this comment

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

Completions calls functions from importFixes, but AFAIK no other codefix has called another codefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infering type from usage does silly import
3 participants