visual studio snippet常用注释片段

Visual Studio 2022 添加自定义代码片段_vs2022 代码片段-CSDN博客

dclass.snippet:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

<CodeSnippet Format="1.0.0">

<Header>

<Title>doxygen类注释模板</Title>

<Shortcut>dclass</Shortcut>

<Description>类注释片段</Description>

<Author>lp</Author>

<SnippetTypes>

<SnippetType>Expansion</SnippetType>

<SnippetType>SurroundsWith</SnippetType>

</SnippetTypes>

</Header>

<Snippet>

<Declarations>

<Literal>

<ID>name</ID>

<ToolTip>类名</ToolTip>

<Default>MyClass</Default>

</Literal>

</Declarations>

<Code Language="cpp"><![CDATA[/**

* @brief 状态事件执行器,customer作为事件执行的参数

* @usage 组件集UI反射更新事件通知eSE_UpdateSGStatusEvent,参数:需要通知反射的UI

*/

]]>

</Code>

</Snippet>

</CodeSnippet>

</CodeSnippets>

dcode.snippet:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

<CodeSnippet Format="1.0.0">

<Header>

<Title>doxygen行注释模板</Title>

<Shortcut>dcode</Shortcut>

<Description>代码注释片段</Description>

<Author>lp</Author>

<SnippetTypes>

<SnippetType>Expansion</SnippetType>

<SnippetType>SurroundsWith</SnippetType>

</SnippetTypes>

</Header>

<Snippet>

<Declarations>

<Literal>

<ID>name</ID>

<ToolTip>类名</ToolTip>

<Default>MyClass</Default>

</Literal>

</Declarations>

<Code Language="cpp"><![CDATA[/// 注释 ///< 注释]]>

</Code>

</Snippet>

</CodeSnippet>

</CodeSnippets>

ddetail.snippet:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

<CodeSnippet Format="1.0.0">

<Header>

<Title>doxygen详细注释模板</Title>

<Shortcut>ddetail</Shortcut>

<Description>详细注释片段</Description>

<Author>lp</Author>

<SnippetTypes>

<SnippetType>Expansion</SnippetType>

<SnippetType>SurroundsWith</SnippetType>

</SnippetTypes>

</Header>

<Snippet>

<Declarations>

<Literal>

<ID>name</ID>

<ToolTip>类名</ToolTip>

<Default>MyClass</Default>

</Literal>

</Declarations>

<Code Language="cpp"><![CDATA[

/**

* @brief 函数简介

* @detail 详细说明

*

* @param 形参 参数说明

* @param 形参 参数说明

* @return 返回说明

* @retval 返回值说明

* @note 注解

* @attention 注意

* @warning 警告

* @exception 异常

*/

]]>

</Code>

</Snippet>

</CodeSnippet>

</CodeSnippets>

dfile.snippet:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

<CodeSnippet Format="1.0.0">

<Header>

<Title>doxygen文件注释模板</Title>

<Shortcut>dfile</Shortcut>

<Description>文件注释片段</Description>

<Author>lp</Author>

<SnippetTypes>

<SnippetType>Expansion</SnippetType>

<SnippetType>SurroundsWith</SnippetType>

</SnippetTypes>

</Header>

<Snippet>

<Declarations>

<Literal>

<ID>name</ID>

<ToolTip>类名</ToolTip>

<Default>MyClass</Default>

</Literal>

</Declarations>

<Code Language="cpp"><![CDATA[

/**

* @file 文件名

* @brief 简介

* @details 细节

* @mainpage 工程概览

* @author 作者

* @email 邮箱

* @version 版本号

* @date 年-月-日

* @license 版权

*/

]]>

</Code>

</Snippet>

</CodeSnippet>

</CodeSnippets>

dfunc.snippet:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

<CodeSnippet Format="1.0.0">

<Header>

<Title>doxygen函数注释模板</Title>

<Shortcut>dfunc</Shortcut>

<Description>函数注释片段</Description>

<Author>lp</Author>

<SnippetTypes>

<SnippetType>Expansion</SnippetType>

<SnippetType>SurroundsWith</SnippetType>

</SnippetTypes>

</Header>

<Snippet>

<Declarations>

<Literal>

<ID>name</ID>

<ToolTip>类名</ToolTip>

<Default>MyClass</Default>

</Literal>

</Declarations>

<Code Language="cpp"><![CDATA[

/*

* @brief 获取与给定ID对应的对象.

* @param [in] guiId FicGUID

* @param [out] guiId FicGUID

* @return 对应的返回说明

* @retval 返回值说明

*/

]]>

</Code>

</Snippet>

</CodeSnippet>

</CodeSnippets>

dother.snippet:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

<CodeSnippet Format="1.0.0">

<Header>

<Title>doxygen其它注释模板</Title>

<Shortcut>dother</Shortcut>

<Description>其它注释片段</Description>

<Author>lp</Author>

<SnippetTypes>

<SnippetType>Expansion</SnippetType>

<SnippetType>SurroundsWith</SnippetType>

</SnippetTypes>

</Header>

<Snippet>

<Declarations>

<Literal>

<ID>name</ID>

<ToolTip>类名</ToolTip>

<Default>MyClass</Default>

</Literal>

</Declarations>

<Code Language="cpp"><![CDATA[

/**

* @see 参考

* @class 引用类

* @var 引用变量

* @enum 引用枚举

* @code 代码块开始

* @endcode 代码块结束

* @bug 缺陷

* @todo TODO

* @example 使用例子说明

* @remarks 备注说明

* @pre 函数前置条件

* @post 用来说明代码项之后的使用条件。

* @deprecated 函数过时说明

* @name 分组名

* @relates <name> 通常用做把非成员函数的注释文档包含在类的说明文档中。

* @since 从哪个版本后开始有这个函数的

* @defgroup 模块名

* @{ 模块开始

* @} 模块结束

* @version 版本号

* @fn 声明一个函数

* @par 开始一个段落,段落名称描述由你自己指定,比如可以写一段示例代码

* - 一级项目符号

* -# 二级项目符号

*/

]]>

</Code>

</Snippet>

</CodeSnippet>

</CodeSnippets>


创作不易,小小的支持一下吧!

相关推荐
maply7 小时前
VSCode 中的 Git Graph扩展使用详解
ide·git·vscode·编辑器·扩展
花花鱼7 小时前
vscode script 中间的function import等关键字 先高亮,然后又灰了,并且按ctrl+/ 注释以html的形式,导致报错处理
ide·vscode·编辑器
恋猫de小郭8 小时前
Android Studio 正式版 10 周年回顾,承载 Androider 的峥嵘十年
android·ide·android studio
时光追逐者10 小时前
Visual Studio使用GitHub Copilot提高.NET开发工作效率
c#·github·.net·copilot·ai编程·微软技术·visual studio
老大白菜20 小时前
Windsurf cursor vscode+cline 与Python快速开发指南
ide·vscode·python
XYu123011 天前
Spring Boot 热部署实现指南
java·ide·spring boot·intellij-idea
张biubiu1 天前
vscode和pycharm的区别
ide·vscode·pycharm
三天不学习2 天前
【AI编程助手系列】国产AI编程工具 DeepSeek+Cline+VSCode 快速集成
ide·vscode·ai编程·deepseek
vistaup2 天前
Android Studio 新版本24.2.2 运行后自动切到 LogCat
android·ide·android studio
工程师焱记3 天前
Vscode的AI插件 —— Cline
ide·人工智能·vscode