Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add in keyword completions #19

Merged
merged 1 commit into from
Dec 19, 2022
Merged

feat: add in keyword completions #19

merged 1 commit into from
Dec 19, 2022

Conversation

zardoy
Copy link
Owner

@zardoy zardoy commented Jun 18, 2022

Don't see a reason too add a setting to disable them. There are awesome!

Feature Description

Typescript docs says that in operator is usually used for object type narrowing. Example from the test:
image
Numbers on right side of the completions means type index, starting from actual position in the union (starting from 1).
When specific key is selected, completion widget displays the type of key in each type of the union.

@zardoy
Copy link
Owner Author

zardoy commented Jun 22, 2022

Just noticed

const a: { a: boolean, b: string } | { a: number, c: number } | string = {} as any
if ('/*|*/' in a) {}
  • in test: uncorrect results
  • in vscode: weird crash

blocked, since i need to investigate both cases...

@zardoy zardoy force-pushed the inKeywordCompletions branch from a646d9d to 244989a Compare December 19, 2022 21:39
@zardoy zardoy merged commit 4f40a80 into main Dec 19, 2022
@zardoy zardoy deleted the inKeywordCompletions branch December 19, 2022 21:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants