microsoft / microsoft/TypeScript
Autocompletion of Template Literal Types with unresolved types.
还没有人认领这个 Issue。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
**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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 TypeScript Language Features 扩展开始,重现报告中描述的模板字面量补全案例。比较未解析类型的行为,然后明确补全应生成带有制表位的代码片段、普通字符串还是联合类型选项;当所选补全在这些案例中的行为保持一致时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- developer-experience
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100