我的php.json仅包含一个代码段:
{
// Place your snippets for php 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"
// }
"Exit": {
"prefix": "xxx",
"body": "exit(__FILE__ . ': ' . __LINE__);",
"description": "Simple exit"
}
}
(我知道这不是有效的JSON,因为JSON不支持注释,但这是VSCode给我的。)
如果我打开一个单独的PHP文件,则可以正常工作,并且 x x x Tab 正确替换为exit(__FILE__ . ': ' . __LINE__);
。但是,如果我打开一个文件夹,然后在该文件夹中编辑PHP文件,则此代码段无效。这是VSCode中的错误,还是我做错了什么?
我正在Ubuntu 18.04上运行,并且是VSCode的新手(因为在升级Ubuntu时Netbeans断开了,但这是a separate issue)。