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

相关推荐
HealthScience1 小时前
vscode默认使用typora打开md(Markdown)文件、vscode中打开Markdown怎么默认使用typora打开
ide·vscode·编辑器
冰淇淋@1 小时前
idea启动项目报错java: OutOfMemoryError: insufficient memory
java·ide·intellij-idea
techzhi1 小时前
this view is read-only (IntelliJ IDEA)
java·ide·intellij-idea
脑子不好的小菜鸟4 小时前
用vscode连接远端ubuntu无法git push,vscode无法连接centos
git·vscode·ubuntu·centos
小池先生4 小时前
idea配置代码注释模板
java·ide·intellij-idea
双河子思4 小时前
Visual Studio 编程工程设置
ide·windows·visual studio
それども4 小时前
2025 Vscode安装Python教程
ide·vscode·编辑器
余衫马6 小时前
JNI 编程 - IDEA 引入外部库
java·ide·intellij-idea
烤奶要加冰6 小时前
PyCharm 社区版全平台安装指南
ide·windows·python·pycharm·mac
家有狸花6 小时前
Pycharm 中jupyter notebook变量窗口只显示特殊变量
ide·jupyter·pycharm