如何在 VS 代码片段中插入制表?
How do I insert tabulation inside VS Code snippet?
我在 VS Code 中有一个代码片段,看起来像这样
"JS arrow function": {
"scope": "javascript, typescript",
"prefix": "af",
"body": [
"const ${1:name} = (${2:props}) => {",
" ",
"}"
],
"description": "Create arrow function"
}
我想在 </code> 制表位之前添加 <code>tabulation
,但 VS Code 显示错误:
字符串中有无效字符。控制字符必须转义。
同时将 4 spaces
放在 </code> 之前效果很好,但我的 eslint 配置需要 <code>tabulation
。
有没有办法把tabulation
放在那里?
\t
也就是转义的制表符。
"JS arrow function": {
"scope": "javascript, typescript",
"prefix": "af",
"body": [
"const ${1:name} = (${2:props}) => {",
"\t",
"}"
],
"description": "Create arrow function"
}
我在 VS Code 中有一个代码片段,看起来像这样
"JS arrow function": {
"scope": "javascript, typescript",
"prefix": "af",
"body": [
"const ${1:name} = (${2:props}) => {",
" ",
"}"
],
"description": "Create arrow function"
}
我想在 </code> 制表位之前添加 <code>tabulation
,但 VS Code 显示错误:
字符串中有无效字符。控制字符必须转义。
同时将 4 spaces
放在 </code> 之前效果很好,但我的 eslint 配置需要 <code>tabulation
。
有没有办法把tabulation
放在那里?
\t
也就是转义的制表符。
"JS arrow function": {
"scope": "javascript, typescript",
"prefix": "af",
"body": [
"const ${1:name} = (${2:props}) => {",
"\t",
"}"
],
"description": "Create arrow function"
}