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

相关推荐
晚风予卿云月1 小时前
Linux编辑器—vim的使用
linux·编辑器·vim
DeadPool loves Star2 小时前
VSCode关闭Shell内联建议
ide·vscode·编辑器
超哥归来2 小时前
关闭vscode中git的行历史提示
ide·git·vscode·编辑器
勇往直前plus2 小时前
PyCharm 找不到包?Anaconda base 环境 pip 装到用户目录的排查与修复
ide·python·pycharm·conda·pip
golang学习记2 小时前
GoLand 2025.3 正式发布:Claude Agent 深度集成!
ide·idea·goland
UP_Continue2 小时前
Linux--vim编辑器
linux·编辑器·vim
朝阳392 小时前
vscode 实用插件【SlashMD — Block-Based Markdown】即时渲染编辑 .md 文件(无工具条,但编辑体验更好)
vscode
愈努力俞幸运2 小时前
git,vscode,pycharm
git·vscode·pycharm
少林and叔叔3 小时前
基于yolov11s模型训练与推理测试(VScode开发环境)
ide·人工智能·vscode·yolo·目标检测
围炉聊科技3 小时前
尝鲜 AWS Agentic IDE:Kiro 一周使用初体验
ide·人工智能·ai编程·aws