jetbrains rider生成自动注释

不仅仅是rider,大部分ide都通用的操作,生成规范的头文件注释,以及为不同种类的类减少复制粘贴的次数。。。

jetbrains rider生成自动注释_第1张图片
找到关键词templates
jetbrains rider生成自动注释_第2张图片
没找到需要的需要,自定义一个lua的
jetbrains rider生成自动注释_第3张图片
N A M E 指 向 文 件 名 , {NAME}指向文件名, NAME{YEAR} ${MONTH} ${DAY} ${TIME} 具体时间没什么好说的,格式自己拼一下就ok

--------------------------------------------------------------
--       @file  ${NAME}.lua
--      @brief  
--
--     @author  Shadowrabbit, [email protected]
--
--   @Modified  ${YEAR}/${MONTH}/${DAY} ${TIME}
--  @Copyright  Copyright (c) 2020, Shadowrabbit
--============================================================
local sq = sq
local type = type
local table = table
local ipairs = ipairs
local assert = assert
local tostring = tostring

local AppDef = class.get("AppDef") --- @type AppDef
local UIDef = class.get("UIDef") --- @type UIDef
local AudioDef = class.get("AudioDef") --- @type AudioDef
local EventDef = class.get("EventDef") --- @type EventDef
local EntityDef = class.get("EntityDef") --- @type EntityDef

--- @class ${NAME} : UIBasePanel
local ${NAME}=assert(self)

${NAME}.Modules={}
${NAME}.Bindings={}

--- @brief 打开时回调
--- @protected
function ${NAME}:OnOpen()
end

--- @brief 关闭时回调
--- @protected
function ${NAME}:OnClose()
end

--- @brief 更新时回调
--- @protected
function ${NAME}:OnRefresh()
end



效果

jetbrains rider生成自动注释_第4张图片
jetbrains rider生成自动注释_第5张图片

你可能感兴趣的:(未分类)