typescript - Vscode Typescript:显示类型的别名而不是其定义
问题描述
我有以下代码
type Opaque<T,U> = T & {_:U};
type EKey = Opaque<number,'EKey'>;
type AKey = Opaque<EKey,'AKey'>;
type PKey = Opaque<AKey,'PKey'>;
let a = <PKey>1;
let b:EKey = a;
当我移动时a
,我希望它显示PKey
而不是Opaque<Opaque<Opaque<"EKey">,"AKey">,"PKey">
。
有没有办法使用内置的 vscode 选项或使用 vscode API 编写我自己的 vscode 扩展来做到这一点?
解决方案
您可以通过编写自己的打字稿语言服务器插件和覆盖来更改快速信息getQuickInfoAtPosition
。
https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin
推荐阅读
- c# - dbml linq 中 where 子句中比较日期的问题
- r - 是否可以使用 group by 和 tidy 将多级模型 (lme) 拟合到重复测量/纵向数据?
- java - 如何在 Spring Data Mongo DB Aggregation 中投影数组元素字段
- java - Criteria API 不执行查询
- node.js - Google App Engine ManagedSSL 不工作
- javascript - Bxslider 字幕动画
- r - 在 r 中重塑数据分组
- angular - 在 MEAN Stack 应用程序中从 mongo db 检索数据
- android - NoSuchMethodError 用于混淆的 openCV 库
- amazon-web-services - 无法使用 aws eclipse 工具包调试 aws-sam 项目