首先安装插件Doxygen Documentation Generator,安装完成之后点击Doxygen插件的设置,按照下面的步骤打开settings.json进行编辑:
在settings.json中追加如下代码:
"doxdocgen.file.copyrightTag": ["Copyright (C), 2023,"],"doxdocgen.file.fileTemplate": "@file \t 【文件名称,不包含绝对路径】","doxdocgen.generic.authorTag": "@author \t 【作者】","doxdocgen.generic.dateTemplate": "@date \t {date}","doxdocgen.generic.briefTemplate": "@brief \t 【简介】","doxdocgen.generic.returnTemplate": "@return \t 【解释返回值】 ","doxdocgen.file.customTag": [ //文件级的自定义注释"@note \t 【重大修改可以放在这里】",],"doxdocgen.generic.customTags": ["@warning\t 【不可重入、阻塞等属性特殊说明】","@note\t 【重大修改】",],"doxdocgen.generic.paramTemplate": "@param \t {param} [in/out], 参数意义","doxdocgen.file.fileOrder": ["copyright","", //这个地方表示换行"file","author","date","brief","custom",],"doxdocgen.generic.order": ["brief","param","return","custom"]
切回vscode,在函数上方输入/***/,然后再第二个*后面按一下enter键,自定义注释模板即可生效,如下图:
多插一句嘴,我的主题插件是Visual Assist Dark Theme插件,改编自visual studio上的西红柿助手 主题颜色。个人感觉还是挺好看的