TypeScript在VS代码中有哪些内置代码段?
我所知道的TypeScript中唯一的内置代码片段是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
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
)和指令注释补全
资源:[| |]