microsoft / microsoft/TypeScript
Autocompletion of Template Literal Types with unresolved types.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
**Extension**: Typescript Language Features
**Feature**: Autocompletion of Template Literal Types with unresolved types.
Hi,
Currently the autocompletion for template literal types stops working as soon as an ambiguous type is used in the template, like number or string.


My idea is, that instead of proposing nothing at all, the autocompletion feature can be extended to propose a snippet with a template literal string and tabstops for the parameters or alternatively a normal string. String unions could be replaced with choices. The end result after selecting the completion would look like something like that:

This could be for example helpful with APIs that typed their Ressource pathes using parametrized template literals.
Contributor guide
Research direction
Start with the TypeScript Language Features extension and reproduce the template-literal completion cases described in the report. Compare behavior for unresolved types, then clarify whether completion should produce a snippet with tab stops, a normal string, or union choices; done means the selected completion behaves consistently for these cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100