vscode自动添加注释说明

1. 安装vscode


双击安装程序,默认安装即可(如:VSCodeSetup-x64-1.70.2.exe)

2. 安装doxygen文档生成插件


1> 打开vscode软件,点击左侧插件管理菜单

2> 点击右上角'...'按钮,选择'Install from VSIX'(联网状态可以直接搜索doxygen下载安装)

3> 选择doxygen离线安装包,如cschlosser.doxdocgen-1.4.0.vsix

3. 修改doxygen默认配置


1> 按'ctrl + shift + p'打开配置项目,选择'Preferences:Open User Settings(JSON)'

2> 黏贴以下配置内容到配置文件中,注意修改authorName等名字信息,可以全局替换一下

json 复制代码
{
    /*GXT-Doxygen Documentation Generator插件使用-Begin*/
    // 作者名和邮箱
    "doxdocgen.generic.authorName": "yangchao",
    "doxdocgen.generic.authorEmail": "yangchao@163.com",
    "doxdocgen.generic.authorTag": "@Author : {author} email:{email}",
    // 日期格式
    "doxdocgen.generic.dateFormat": "YYYY-MM-DD",
    "doxdocgen.generic.dateTemplate": "@Creat Date : {date}",
    // 简介格式
    "doxdocgen.generic.briefTemplate": "@brief{indent:8}{text}",
    // 文件注释的格式
    "doxdocgen.file.fileTemplate": "@File Name: {name}",
    "doxdocgen.file.versionTag": "@Version : 1.0",
    "doxdocgen.file.copyrightTag": [
        "@copyright Copyright (c) {year} Co., Ltd. All rights reserved."
    ],
    // 自定义文件注释格式
    "doxdocgen.file.customTag": [
        "modification history :",
        "Date:       Version:      Author:     ",
        "Changes: ",
    ],
    // 文件注释组成及顺序
    "doxdocgen.file.fileOrder": [
        "file",    // @file
        "brief",    // @brief 简介
        "author",    // 作者
        "version",    // 版本
        "date",    // 日期
        "empty",    // 空行
        "copyright",// 版权
        // "custom"    // 自定义
    ],
    // 参数注释和返回注释的格式
    "doxdocgen.generic.paramTemplate": "@param{indent:8}{param}: ",
    "doxdocgen.generic.returnTemplate": "@return{indent:8}{type}: ",
    // 函数注释组成及顺序
    "doxdocgen.generic.order": [
        "brief",
        "tparam",
        "param",
        "return"
    ],
    "editor.fontFamily": "Courier New",
    "window.zoomLevel": 1,
    /*GXT-Doxygen Documentation Generator插件使用-End*/
}

3> 配置完成后即可使用,在文件头或者函数前都可以输入'/**'然后按回车即可生成固定格式的注释

相关推荐
银迢迢6 小时前
idea控制台中文乱码采用好几种方法一直解决不了
java·ide·intellij-idea
好好沉淀7 小时前
IDEA 取消 Save Actions 自动删除未用导入(前端开发避坑)
java·ide·intellij-idea
添加shujuqudong1如果未回复8 小时前
深度探索:自动驾驶路径规划与避障功能实现——从运动学到动力学模型到决策规划算法的完整系列
ide
淡水瑜10 小时前
Visual Studio 实操
ide·visual studio
aduzhe14 小时前
vscode 自动化格式问题
ide·vscode·自动化
齐齐大魔王15 小时前
系统安装概述
编辑器·github
invicinble16 小时前
关于认识,和优化idea开发
java·ide·intellij-idea
剽悍一小兔16 小时前
openEuler开发工具链与IDE支持性能深度测试
ide
kkk_皮蛋17 小时前
从零开始:用 Android Studio 开发一个 AI 智能日记 App
android·ide·android studio
sherlock_ye417 小时前
‘jupyter‘ 不是内部或外部命令,也不是可运行的程序或批处理文件,最终解决方案!
ide·python·jupyter·conda