korofileheader是一款用于在 VSCode
中用于生成文件头部注释和函数注释的插件。根据需要修改了默认设置。
一、在vscode左下角点击设置按钮,选择“设置”,然后输入“fileheader”,
随便点击哪个"在setting.json"中编辑,输入以下设置后保存,然后重启vscode更新设置。
二、自定义的配置如下:
"fileheader.configObj": {
"createFileTime": true,
"language": {
"c/cpp/h/hpp/java": {
"head": "/**\r\n****************************************************************************************",
"middle": " * @",
"end": "****************************************************************************************\r\n*/"
},
"languagetest": {
"head": "/$$",
"middle": " $ @",
"end": " $/",
"functionSymbol": {
"head": "/** ",
"middle": " * @",
"end": " */"
},
"functionParams": "js"
}
},
"autoAdd": false,
"autoAddLine": 100,
"autoAlready": true,
// 默认注释 没有匹配到注释符号的时候使用。
"annotationStr": {
"head": "/*",
"middle": " * @",
"end": " */",
"use": false
},
"headInsertLine": {
"php": 2,
"sh": 2
},
"beforeAnnotation": {
"文件后缀": "该文件后缀的头部注释之前添加某些内容"
},
"afterAnnotation": {
"文件后缀": "该文件后缀的头部注释之后添加某些内容"
},
"specialOptions": {
"param":"param[in]"
},
"switch": {
"newlineAddAnnotation": true
},
"supportAutoLanguage": [],
"prohibitAutoAdd": [
"json"
],
"folderBlacklist": [
"node_modules",
"文件夹禁止自动添加头部注释"
],
"prohibitItemAutoAdd": [
"项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
],
"moveCursor": true,
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"atSymbol": [
"@",
"@"
],
"atSymbolObj": {
"文件后缀": [
"头部注释@符号",
"函数注释@符号"
]
},
"colon": [
": ",
": "
],
"colonObj": {
"文件后缀": [
"头部注释冒号",
"函数注释冒号"
]
},
"filePathColon": "路径分隔符替换",
"showErrorMessage": false,
"writeLog": false,
"wideSame": false,
"wideNum": 13,
"functionWideNum": 0,
"CheckFileChange": false,
"createHeader": true,
"useWorker": false,
"designAddHead": false,
"headDesignName": "random",
"headDesign": false,
"cursorModeInternalAll": {},
"openFunctionParamsCheck": true,
"functionParamsShape": "no type",
"typeParamOrder": "param",
"customHasHeadEnd": {},
"throttleTime": 60000
},
"fileheader.customMade": {
"FilePath":"only file name",
"Author":"jack",
"Date":"Do not edit",
"LastEditors":"",
"LastEditTime":"Do not Edit",
// "custom_string_obkoro1~custom_string_obkoro100都可以输出自定义信息"
"custom_string_obkoro1_copyright":"Copyright: ${now_year} xxxTech CO.,LTD. All Rights Reserved.", // 版权声明 保留所有权利 自动替换年份
"Descripttion":"",
},
"fileheader.cursorMode": {
"brief":"",
"param" : " ",
"return":""
},
头文件注释:ctrl + windows + i ,结果如下:
/**
****************************************************************************************
* @FilePath: filename.c
* @Author: jack
* @Date: 2022-04-27 15:54:02
* @LastEditors:
* @LastEditTime: 2022-04-27 15:54:11
* @Copyright: 2022 xxxTech CO.,LTD. All Rights Reserved.
* @Descripttion:
****************************************************************************************
*/
函数注释:ctrl + windows + j, 结果如下:
/**
****************************************************************************************
* @brief:
* @param[in] NotifyClass
* @param[in] NotifyID
* @param[in] *pdata
* @param[in] dataLen
* @return
****************************************************************************************
*/