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

相关推荐
牢七21 分钟前
Slim-4.x php审计 报错分析
android·开发语言·ide·安全·php
cuckooman21 分钟前
Build Tools for Visual Studio 2022 如何下载
ide·visual studio
FakeOccupational1 小时前
【VSCODE 插件 调试】 Visual Studio Code + Continue + Ollama实现本地版 Cursor / Copilot
ide·vscode·copilot
马猴烧酒.2 小时前
【JAVA算法|hot100】贪心算法类型题目详解笔记
java·开发语言·ide·笔记·算法·spring·贪心算法
山峰哥3 小时前
SQL优化全攻略:从索引策略到Explain实战解析
大数据·数据库·sql·oracle·性能优化·编辑器
golang学习记5 小时前
IDEA 2026.1 EAP 5 发布:K2模式更强了!
java·ide·intellij-idea
电子科技圈19 小时前
从工具到平台:如何化解跨架构时代的工程开发和管理难题
人工智能·设计模式·架构·编辑器·软件工程·软件构建·设计规范
JohnnyCS19 小时前
VSCode 自动换行设置完全指南
vscode·编辑器
小龙报20 小时前
【算法通关指南:算法基础篇】二分算法: 1.A-B 数对 2.烦恼的高考志愿
c语言·开发语言·数据结构·c++·vscode·算法·二分
蜜汁小强20 小时前
Vim简单配置: 加点颜色加点格式
编辑器·vim·excel