代码拉取完成,页面将自动刷新
自用的 jdDoc 格式注释模板注入插件,原理是采用正则匹配,以前不知道有AST模块的时候写的,也没时间重构,就边用边更新了。
注意: 插件市场有专业的功能相似的插件,我只是单纯为了自己用的爽菜写的 😁,才不是因为它配置太复杂才自己造轮子,请有需要的朋友请使用专业插件。
- 本插件为团队内部打造使用,不对外更新负责,
- 2023年了,前端建议采用VSCode。
py
和js系
快捷键:Alt + q
在函数行键入即可,暂时 py 使用比较多,js 和 ts 部分语法不能识别,也没空更新
// Packages/User/cps.sublime-settings
{
"name": "tett 插件",
"author": "CPS",
"mail": "373704015@qq.com", //本插件任何问题请联系qq
// prettier-ignore
"cps_comments_creator": {
// 全局默认配置
"max_search_count":80, // 搜索行数(正数从上向下查找, 负数反之)
"params_alignment":" ", // [indent<string>] 是否对齐参数
"comments_direction":"up", // "down"|"up" 函数名字上一行,函数名字下一行
"default_tmpl":{
"comments_contexts":{
"Description":true,
"param":":param {type} {name} {description}",
"returns":":returns {type} {description}",
}
},
/* 根据后缀名设置 */
"py": {
"comments_direction": "down",
"comments_contexts":{
"Description":"@Description {description}\n",
"param":"- param {name} :{type} {description}",
"returns":"\n@returns `{type}` {description}"
},
"comments_header": [
" \"\"\"", // 注释区的开始标识
" ", // 内容位置的前缀
" \"\"\"", // 注释区的结束
]
},
"js":{
"comments_contexts":{
"Description":"@Description - {description}\n",
"param":"@param {type} {name} - {description}",
"returns":"\n@returns {type} - {description}"
},
"comments_header": [
"/**", // /**
" * ", // * 内容位置的前缀
" */" // */
]
},
"mjs":{
"comments_contexts":{
"Description":"@Description - {description}\n",
"param":"@param {type} {name} - {description}",
"returns":"\n@returns {type} - {description}"
},
"comments_header": [
"/**", // /**
" * ", // * 内容位置的前缀
" */" // */
]
},
"ts":{
"comments_contexts":{
"Description":"@Description - {description}\n",
"param":"@param {type} {name} - {description}",
"returns":"\n@returns {type} - {description}"
},
"comments_header": [
"/**", // /**
" * ", // * 内容位置的前缀
" */" // */
]
},
"vue":{
"comments_contexts":{
"Description":" @Description {description}\n",
"param":" @param {type} {name} {description}",
"returns":"\n @returns {type} {description}"
},
"comments_header": [
"/**", // /**
" * ", // * @Description:
" */" // */
]
}
}
// prettier-ignore
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。