Skip to content
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

Simplify string literal completions #21415

Merged
2 commits merged into from
Feb 6, 2018
Merged

Simplify string literal completions #21415

2 commits merged into from
Feb 6, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jan 25, 2018

Instead of creating CompletionInfo directly, return a union of several kinds and convert to CompletionInfo at the end. This is useful because we won't always want a CompletionInfo (#21374). It also cuts down on code since we were duplicating the code to create CompletionInfo in a lot of places.

Note: Previously, getStringLiteralCompletionEntriesFromCallExpression returned isNewIdentifierLocation: true, but isNewIdentifierLocation: false returned isNewIdentifierLocation: false. In both cases, we are getting the string literal from a contextual type, so I would expect these situations to work the same, and now we return isNewIdentifierLocation: true in both locations. Relevant test completionForStringLiteral3 which tests for this was added in #8428. @mhegazy

@ghost ghost requested review from armanio123 and mhegazy January 25, 2018 21:31
@ghost ghost merged commit ba18337 into master Feb 6, 2018
@ghost ghost deleted the string_completions branch February 6, 2018 20:31
ghost pushed a commit that referenced this pull request Feb 6, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
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