Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TypeScript在VS代码中有哪些内置代码段?_Typescript_Visual Studio Code - Fatal编程技术网

TypeScript在VS代码中有哪些内置代码段?

TypeScript在VS代码中有哪些内置代码段?,typescript,visual-studio-code,Typescript,Visual Studio Code,我所知道的TypeScript中唯一的内置代码片段是ctor,它生成一个构造函数方法。VS代码中还有哪些可用的TypeScript代码段?自v1.47.0起,它们支持以下功能: Constructor / prefix: ctor Class Definition / prefix: class Public Method Definition / prefix : public method Private Method Definition / prefix : private method

我所知道的TypeScript中唯一的内置代码片段是
ctor
,它生成一个构造函数方法。VS代码中还有哪些可用的TypeScript代码段?

自v1.47.0起,它们支持以下功能:

Constructor / prefix: ctor
Class Definition / prefix: class
Public Method Definition / prefix : public method
Private Method Definition / prefix : private method
Import external Module / prefix: import statement
Property getter / prefix : get
Property setter / prefix: set
Log to the console / prefix: log
Log warning / prefix: warn
Log error / prefix: error
Define a full property / prefix: prop
Triple-slash reference / prefix: ref
Throw exception / prefix: throw
For loop / prefix: for
For-Each Loop using => / prefix: foreach =>
For-In Loop / prefix: forin
For-Of Loop / prefix: forof
Function Statement / prefix: function
If Statement / prefix: if
If-Else Statement / prefix: ifelse
New Statement / prefix: new
Switch Statement / prefix: switch
While Statement / prefix: while
Do-While Statement / prefix: dowhile
Try-Catch Statement / prefix: trycatch
Set Timeout Function / prefix: settimeout
Region Start / prefix: #region
Region End / prefix: #endregion
此外,它们还支持jsDoc(
“typescript.suggest.completeJSDocs”:true
)和指令注释补全


资源:[| |]