Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C语言参数中有空格,会导致生成注释大括号出现错乱 #618

Open
IJustLoveMyself opened this issue Sep 12, 2024 · 2 comments

Comments

@IJustLoveMyself
Copy link

当函数参数后面多出一个空格,其生成注释中param 类型的大括号会错乱

注释设置(必填):

VsCode设置:

{
    "workbench.colorTheme": "Default Dark Modern",
    "fileheader.cursorMode": {
        //此为函数注释
        "******************************************************************************":"",
        "func":"[]",
        "description":"", 
        "note": "",
        "author":"gxf",
        "param": "",        
        "return": "",
        "==============================================================================":"",      
    },
    "fileheader.configObj": {
        "createFileTime": true,
        "language": {
            "languagetest": {
                "head": "/$$",
                "middle": " $ @",
                "end": " $/",
                "functionSymbol": {
                    "head": "/** ",
                    "middle": " * @",
                    "end": " */"
                },
                "functionParams": "js"
            }
        },
        "autoAdd": true,
        "autoAddLine": 100,
        "autoAlready": true,
        "annotationStr": {
            "head": "/*",
            "middle": " * @",
            "end": " */",
            "use": false
        },
        "headInsertLine": {
            "php": 2,
            "sh": 2
        },
        "beforeAnnotation": {
            "文件后缀": "该文件后缀的头部注释之前添加某些内容"
        },
        "afterAnnotation": {
            "文件后缀": "该文件后缀的头部注释之后添加某些内容"
        },
        "specialOptions": {
            "特殊字段": "自定义比如LastEditTime/LastEditors"
        },
        "switch": {
            "newlineAddAnnotation": true
        },
        "supportAutoLanguage": [],
        "prohibitAutoAdd": [
            "json"
        ],
        "folderBlacklist": [
            "node_modules",
            "文件夹禁止自动添加头部注释"
        ],
        "prohibitItemAutoAdd": [
            "项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
        ],
        "moveCursor": true,
        "dateFormat": "YYYY-MM-DD HH:mm:ss",
        "atSymbol": [
            "@",
            "@"
        ],
        "atSymbolObj": {
            "文件后缀": [
                "头部注释@符号",
                "函数注释@符号"
            ]
        },
        "colon": [
            ": ",
            ": "
        ],
        "colonObj": {
            "文件后缀": [
                "头部注释冒号",
                "函数注释冒号"
            ]
        },
        "filePathColon": "路径分隔符替换",
        "showErrorMessage": false,
        "writeLog": false,
        "wideSame": false,
        "wideNum": 13,
        "functionWideNum": 0,
        "CheckFileChange": false,
        "createHeader": false,
        "useWorker": false,
        "designAddHead": false,
        "headDesignName": "random",
        "headDesign": false,
        "cursorModeInternalAll": {},
        "openFunctionParamsCheck": true,
        "functionParamsShape": [
            "{",
            "}"
        ],
        "functionBlankSpaceAll": {},
        "functionTypeSymbol": "*",
        "typeParamOrder": "type param",
        "customHasHeadEnd": {},
        "throttleTime": 60000,
        "functionParamAddStr": "",
        "NoMatchParams": "no show param"
    },
    "fileheader.customMade": {   
        //此为头部注释
        "******************************************************************************":"",
        "Description": "",
        "Autor": "gxf",
        "Date": "Do not edit",
        "LastEditors": "gxf",
        "LastEditTime": "Do not edit",
        "==============================================================================":"",       
    },
    "files.autoSave": "afterDelay",
}

文件后缀(必填):

.c

你得到的注释(必填):

当函数参数多出一个空格,如下面的函数buf后面有一个空格会导致注释出错,其生成的注释如下所示,buf的大括号显示错乱

/**
 * @******************************************************************************: 
 * @func: []
 * @description: 
 * @note: 
 * @author: gxf
 * @param {u8 *buf} : 
 * @param {u8} len: 
 * @return {*}: 
 * @==============================================================================: 
 */
static void gxf_log_usart_send_bytes(u8 *buf ,u8 len)

当函数的参数没有空格的时候,注释正常,如下所示,buf后面紧挨着逗号,没有空格,注释如下所示:

/**
 * @******************************************************************************: 
 * @func: []
 * @description: 
 * @note: 
 * @author: gxf
 * @param {u8} *buf: 
 * @param {u8} len: 
 * @return {*}: 
 * @==============================================================================: 
 */
static void gxf_log_usart_send_bytes(u8 *buf,u8 len)

预期的行为(必填):

在参数后面有空格的时候也可以正常显示,如下所示,buf参数后面有空格

/**
 * @******************************************************************************: 
 * @func: []
 * @description: 
 * @note: 
 * @author: gxf
 * @param {u8} *buf: 
 * @param {u8} len: 
 * @return {*}: 
 * @==============================================================================: 
 */
static void gxf_log_usart_send_bytes(u8 *buf ,u8 len)
@IJustLoveMyself
Copy link
Author

重新安装测试了一下,问题不是主线4.94,是网友提供的版本的问题,该版本是为了解决注释生成缓慢https://gitee.com/tyysoft/koroFileHeader/releases/tag/4.9.4

@IJustLoveMyself
Copy link
Author

重新安装测试了一下,问题不是主线4.94,是网友提供的版本的问题,该版本是为了解决注释生成缓慢https://gitee.com/tyysoft/koroFileHeader/releases/tag/4.9.4

另外这个网友提供的版本对于 void md_hall_test(void) 这样的无参函数在我这边无法生成注释

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant