Skip to content

Use import().T for import completions/fixes of pure types in JS files#25852

Merged
2 commits merged into
masterfrom
importCompletions_importType
Jul 26, 2018
Merged

Use import().T for import completions/fixes of pure types in JS files#25852
2 commits merged into
masterfrom
importCompletions_importType

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jul 21, 2018

Fixes #23407

Note: converted importFixes from passing around symbolToken to position because we may get an import completion at a location with no Identifier there yet.

@ghost ghost force-pushed the importCompletions_importType branch from b025f65 to 317a77d Compare July 21, 2018 02:06
@ghost ghost force-pushed the importCompletions_importType branch from 317a77d to 9feb4de Compare July 21, 2018 02:10
@ghost ghost requested review from amcasey and sheetalkamat July 23, 2018 16:51
host: LanguageServiceHost,
preferences: UserPreferences,
): ReadonlyArray<ImportFix> {
const checker = program.getTypeChecker();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not exit early here when position is undefined ? without doing any of the work.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We actually might return a result if we don't need to add a qualifier to the use. We would add an import at the top of the file and not need position.

@ghost ghost merged commit 0227997 into master Jul 26, 2018
@ghost ghost deleted the importCompletions_importType branch July 26, 2018 23:17
@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.

1 participant