VSCODE 配置用户代码片段:通过header添加避免重复包含问题。
{
"c c++ Header": {
"scope": "c,cpp",
"prefix": "header",
"body": [
"#ifndef __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H__",
"#define __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H__",
"",
"$0",
"",
"#endif /* __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H__ */"
],
"description": "Add #ifndef,#define and #endif"
}
}