我有以下用户摘要:
{
/*
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
}
*/
"Small comment": {
"prefix": "//=",
"body": [
"// ===================================",
"// ${1:COMMENT}",
"// ==================================="
],
"description": "Small comment"
}
}
我在第二个主体线上发现以下错误:
Invalid characters in string. Control characters must be escaped.
我认为${1:somestring}
是有效的占位符。我在构造这个片段时做错了什么?
我在寻找答案时刚刚发现了这个问题,我使用了摘要发电机,因此假设每个格式的格式是相同的,但是不认为我粘贴在其中的代码中。<<<<<<<<<<<</p>
卸下选项卡并使用的空间而不是为我修复了格式。
希望这会有所帮助。:)