Skip to content

Add assert keyword in completions #47644

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 2 commits into from
Jan 28, 2022
Merged

Add assert keyword in completions #47644

merged 2 commits into from
Jan 28, 2022

Conversation

gabritto
Copy link
Member

@gabritto gabritto commented Jan 27, 2022

Fixes #46371

I added a new function, getContextualKeywords, that is called in completionInfoFromData.
The alternative I've considered would be to use the existing keywordFilter mechanism, and have a new filter, KeywordFilter.Assert. However, that felt odd and difficult to implement, because keywordFilter is created in getCompletionData and assigned inside that function, and in other functions it calls, in multiple places. So it's (a) hard to follow all the conditionals and function calls that could assign to keywordFilter to make sure the variable ends up being assigned to KeywordFilter.Assert in the right places, and (b) the existing conditionals didn't reflect the cases where we should offer assert in completions.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Jan 27, 2022
@gabritto gabritto merged commit 9028051 into main Jan 28, 2022
@gabritto gabritto deleted the gabritto/issue46371 branch January 28, 2022 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No completion for assert keyword
3 participants