满足格式后,为什么我的 vs 代码片段无法运行?
Why will my vs-code snippet not work when the format has been met?
我正在尝试获取代码片段来执行此操作
recipes.addShaped("name", output,
[
[input,input,input],
[input,input,input],
[input,input,input]
]);
我正在尝试使用的代码是这个
"Add a shaped": {
"prefix": ["rec", "add"],
"body": ["
recipes.addShaped("${1:name}", ${2:output},
[
[${3:input},${4:input},${5:input}],
[${6:input},${7:input},${8:input}],
[${9:input},${10:input},${11:input}]
]);
"],
"description": "Add a shaped recipe."
}
如有任何帮助,我们将不胜感激。
段
试试这个:
"Add a shaped": {
"prefix": ["rec", "add"],
"body": [
"recipes.addShaped(\"${1:name}\", ${2:output},",
"[",
"[${3:input},${4:input},${5:input}],",
"[${6:input},${7:input},${8:input}],",
"[${9:input},${10:input},${11:input}]",
"]);"
],
"description": "Add a shaped recipe."
},
正文的所有行都必须单独引用,并且一行中的引号必须转义。
并且结果将显示为与您当前的缩进对齐,而不必像您那样将正文放在最左边。只需正常缩进代码片段即可设置左点。从那里缩进的任何缩进都会缩进结果。
我正在尝试获取代码片段来执行此操作
recipes.addShaped("name", output,
[
[input,input,input],
[input,input,input],
[input,input,input]
]);
我正在尝试使用的代码是这个
"Add a shaped": {
"prefix": ["rec", "add"],
"body": ["
recipes.addShaped("${1:name}", ${2:output},
[
[${3:input},${4:input},${5:input}],
[${6:input},${7:input},${8:input}],
[${9:input},${10:input},${11:input}]
]);
"],
"description": "Add a shaped recipe."
}
如有任何帮助,我们将不胜感激。 段
试试这个:
"Add a shaped": {
"prefix": ["rec", "add"],
"body": [
"recipes.addShaped(\"${1:name}\", ${2:output},",
"[",
"[${3:input},${4:input},${5:input}],",
"[${6:input},${7:input},${8:input}],",
"[${9:input},${10:input},${11:input}]",
"]);"
],
"description": "Add a shaped recipe."
},
正文的所有行都必须单独引用,并且一行中的引号必须转义。
并且结果将显示为与您当前的缩进对齐,而不必像您那样将正文放在最左边。只需正常缩进代码片段即可设置左点。从那里缩进的任何缩进都会缩进结果。