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把插件啥的不默认放在C盘
java·ide·intellij-idea
JMchen1238 小时前
Cursor高阶玩法:.cursorrules编写与Spec-Driven开发实战,把AI调教成专属结对编程搭档
人工智能·vscode·kotlin·cursor·结对编程·spec-driven·.cursorrules
我是Superman丶9 小时前
Arduino IDE 安装教程:Windows/macOS/Linux 开发环境搭建
ide·windows·macos
LaughingZhu12 小时前
Product Hunt 每日热榜 | 2026-09-08
java·ide·深度学习·百度·intellij-idea
千码君201614 小时前
提词器项目V1.0功能分析
ide·macos·xcode
2501_9151063215 小时前
Swift 4开发环境设置教程:xCode安装与Playground入门
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
一支黑色の铅笔16 小时前
VSCode 克隆Git项目
ide·git·vscode
小毛驴85017 小时前
Jupyter Notebook 安装步骤
ide·python·jupyter
蓝白云1 天前
告别繁琐配置!TreeATE Copilot 插件 VS Code 完整使用教程
vscode·copilot
蓝桉柒71 天前
下载idea,用idea输入一个程序
java·ide·intellij-idea