koro1FileHeader icon indicating copy to clipboard operation
koro1FileHeader copied to clipboard

C函数无法获取return

Open xiaohuihuitop opened this issue 3 years ago • 1 comments

C函数无法获取return

随便写了一个c函数进行测试

uint8_t test(uint8_t a,uint8_t b) { return 0; }

得到的return 是空的。

注释设置(必填):

// 函数注释
"fileheader.cursorMode": {
    "Description": "xhh >> ", // 函数注释生成之后,光标移动到这里
    "param": "", // param 开启函数参数自动提取 需要将光标放在函数行或者函数上方的空白行
    "return": "",
},
"fileheader.configObj": {
    "openFunctionParamsCheck": true,  
    "autoAdd": false,  
    "autoAlready": true,  
    "showErrorMessage": true, 
    "writeLog": true,  
    "NoMatchParams": "no show param and return",  
    "functionParamsShape": [ "{", "}"],  
    "functionTypeSymbol": "NULL", 
    "typeParamOrder": "type param", 
    "functionParamAddStr": " : " , 
   }

VsCode设置:

文件后缀(必填):

main.c

你得到的注释(必填):

你生成的注释为:

/**

  • @Description: xhh >>
  • @param {uint8_t} a :
  • @param {uint8_t} b :
  • @return {NULL} */

也可以贴上截图:

预期的行为(必填):

预期得到的注释/行为:

/**

  • @Description: xhh >>
  • @param {uint8_t} a :
  • @param {uint8_t} b :
  • @return {uint8_t} */

也可以贴上截图:

屏幕截图(选填)

如果方便的话,添加截图来帮助解释你的问题:

问题相关(选填)

在这里添加关于这个问题的任何其他上下文。

错误日志(选填):

没有报错

xiaohuihuitop avatar Sep 06 '22 08:09 xiaohuihuitop

我的也是无法获取return,配置如下: // 头部注释 "fileheader.customMade": { // 头部注释默认字段 "LastEditTime": "Do not edit", // 设置后,保存文件更改默认更新最后编辑时间 "LastEditors": "yutian", // 设置后,保存文件更改默认更新最后编辑人 "Description": "", // "FilePath": "Do not edit", // 设置后,默认生成文件相对于项目的路径 // "custom_string_obkoro1": "" }, // 函数注释 "fileheader.cursorMode": { // 函数注释默认字段 "brief":"", "param":"", "return":"" }, // 插件配置项 "fileheader.configObj": { "autoAdd": true, // 检测文件没有头部注释,自动添加文件头部注释 "autoAddLine": 50, // 文件超过多少行数 不再自动添加头部注释 "autoAlready": true, // 只添加插件支持的语言以及用户通过language选项自定义的注释 "supportAutoLanguage": [], // 设置之后,在数组内的文件才支持自动添加 // 自动添加头部注释黑名单 "prohibitAutoAdd": ["json","xml"], "wideSame": true, // 头部注释等宽设置 "wideNum": 13, // 头部注释字段长度 默认为13 "functionWideNum": 6, // 函数注释等宽设置 设为0 即为关闭 // 头部注释第几行插入 "headInsertLine": { "cpp": 1,//C++文件 插入到第二行 "c": 1,//c文件 插入第二行 "py": 1//python文件插入第二行 }, "dateFormat": "YYYY-MM-DD HH:mm:ss", "createHeader": true, // 新建文件自动添加头部注释 "openFunctionParamsCheck": true, // 开启关闭自动提取添加函数参数 "functionParamsShape": ["[", "]"], // 函数参数外形自定义 "functionTypeSymbol": "*", // 参数没有类型时的默认值 "functionParamAddStr": ":", // 默认不增加字符串,现在添加冒号 "typeParamOrder": "type param", // 参数类型 和 参数的位置自定义 // 自定义语言注释,自定义取消 head、end 部分 // 不设置自定义配置language无效 默认都有head、end "customHasHeadEnd": {}, // "cancel head and function" | "cancel head" | "cancel function" "throttleTime": 1200000, // 对同一个文件 需要过2分钟再次修改文件并保存才会更新注释 // 自定义语言注释符号,覆盖插件的注释格式 "language": { // js后缀文件 "js": { "head": "/$$", "middle": " $ @", "end": " $/", // 函数自定义注释符号:如果有此配置 会默认使用 "functionSymbol": { "head": "/******* ", // 统一增加几个*号 "middle": " * @", "end": " */" }, "functionParams": "typescript" // 函数注释使用ts语言的解析逻辑 }, // 一次匹配多种文件后缀文件 不用重复设置 "h/hpp/cpp/c": { "head": "/** ", // 统一增加几个*号 "middle": " * @", "end": " */" }, // 针对有特殊要求的文件如:test.blade.php "blade.php":{ "head": "<!--", "middle": " * @", "end": "-->", } }, // 默认注释 没有匹配到注释符号的时候使用。 "annotationStr": { "head": "/*", "middle": " * @", "end": " */", "use": false }, }, 注释结果如下 /**

  • @brief :
  • @param [unsigned int] major:
  • @param [char] *name:
  • @param [file_operations] *fops:
  • @return [*] */ static int register_chrdev(unsigned int major, const char *name,const struct file_operations *fops) { return __register_chrdev(major, 0, 256, name, fops); }

maxiaogood avatar Sep 06 '22 15:09 maxiaogood

我也是无法获得return的类型

maxiaogood avatar Dec 13 '22 05:12 maxiaogood

return类型插件不支持读取

OBKoro1 avatar Jan 28 '23 06:01 OBKoro1