Skip to content

Make getTextOfIdentifierOrLiteral only accept Identifier | StringLiteralLike | NumericLiteral #22002

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
2 commits merged into from
Feb 21, 2018

Conversation

ghost
Copy link

@ghost ghost commented Feb 16, 2018

Like with #21981, tightening this function required reexamining some casts elsewhere.

@ghost ghost requested a review from weswigham February 16, 2018 21:42
@ghost ghost force-pushed the getTextOfIdentifierOrLiteral branch from 9d30514 to b29e012 Compare February 16, 2018 21:44
…eral only accept Identifier | StringLiteralLike | NumericLiteral
@ghost ghost force-pushed the getTextOfIdentifierOrLiteral branch from b29e012 to 05892a5 Compare February 16, 2018 21:51
Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

This is stealth mode also enabling string literal completions within no substitution template literals, no? That should probably be tested so we know if we break it. Otherwise, seems fine.

@ghost
Copy link
Author

ghost commented Feb 20, 2018

In completions.ts, we are getting the name from getNameOfDeclaration(m);. That shouldn't ever be a NoSubstitutionTemplateLiteral (even given the changes to getDeclarationName, since getNameOfDeclaration still won't return one).
Also, we already support string literal completions inside NoSubstitutionTemplateLiteral -- see completionListAfterSTringLiteralTypeWithNoSubstitutionTemplateLiteral.ts.

@ghost ghost merged commit 8a52ead into master Feb 21, 2018
@ghost ghost deleted the getTextOfIdentifierOrLiteral branch February 21, 2018 19:05
@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.

2 participants