[英]Is there a VSCode extension that adds a Quick Fix for adding the explicit type to a field for Typescript?
I want to have a Quick Fix action ( cmd +.
) that adds the explicit type to a field, parameter, or function return (where it is otherwise inferred).我想要一个快速修复操作(
cmd +.
),它将显式类型添加到字段、参数或 function 返回(否则会推断)。
To turn转
const specificQuesiton = await Question.query().findById(1)
into进入
const specificQuesiton: Question = await Question.query().findById(1)
Found one!找到一个!
https://marketplace.visualstudio.com/items?itemName=nick-lvov-dev.typescript-explicit-types https://marketplace.visualstudio.com/items?itemName=nick-lvov-dev.typescript-explicit-types
Here's an example of it in action:这是它的一个例子:
I also found this one which just does return type (the one above does everything).我还发现这个只是返回类型(上面的那个什么都做)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.