Skip to content

求助,py和js的格式不完全相同如何修改配置 #631

@doubleZ0108

Description

@doubleZ0108

你好,非常感谢你的开源项目!

我在使用中发现在同样的配置下python和javascript的头部注释不完全相同,具体而言:

# -*- coding: utf-8 -*-
'''
@File         : /app.py
@Author       : xxx
@Description  : 
@CreateTime   : 2025/03/19 11:03:16
@LastEditTime : 2025/03/21 11:19:55
@
@Copyright (c) 2025, xxx
'''
/*
 * @File         : /static/script.js
 * @Author       : xxx
 * @Description  : 
 * @CreateTime   : 2025/03/19 14:00:53
 * @LastEditTime : 2025/03/21 11:20:00
 * 
 * Copyright (c) 2025, xxx
 */

主要是python会在版权信息和空行上也添加@,但js就排版很完美,简直逼死强迫症,不知道是哪里配置的有问题,求解答

我的详细配置如下

"fileheader.configObj": {

        "createFileTime": true,
        "language": {
            "languagetest": {
                "head": "/$$",
                "middle": " $ @",
                "end": " $/",
                "functionSymbol": {
                    "head": "/** ",
                    "middle": " * @",
                    "end": " */"
                },
                "functionParams": "js"
            },
            "python": {
                "head": "# -*- coding: utf-8 -*-\n'''",
                "middle": "@",
                "end": "'''",
                "functionSymbol": {
                    "head": "# ",
                    "middle": "# @",
                    "end": "# "
                },
                "functionParams": "py"
            }
        },
        "autoAdd": false,
        "autoAddLine": 100,
        "autoAlready": true,
        "annotationStr": {
            "head": "/*",
            "middle": " * @",
            "end": " */",
            "use": false
        },
        "headInsertLine": {
            "php": 2,
            "sh": 2
        },
        "beforeAnnotation": {
            "文件后缀": "该文件后缀的头部注释之前添加某些内容"
        },
        "afterAnnotation": {
            "文件后缀": "该文件后缀的头部注释之后添加某些内容"
        },
        "specialOptions": {
            // "特殊字段": "自定义比如LastEditTime/LastEditors"
            "FilePath": "File",
            "Date": "CreateTime"
        },
        "switch": {
            "newlineAddAnnotation": true
        },
        "supportAutoLanguage": [],
        "prohibitAutoAdd": [
            "json", "txt", "csv", "md"
        ],
        "folderBlacklist": [
            "node_modules",
            "文件夹禁止自动添加头部注释"
        ],
        "prohibitItemAutoAdd": [
            "项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
        ],
        "moveCursor": true,
        "dateFormat": "YYYY/MM/DD HH:mm:ss",
        "atSymbol": [
            "@",
            "@"
        ],
        "atSymbolObj": {
            "文件后缀": [
                "头部注释@符号",
                "函数注释@符号"
            ]
        },
        "colon": [
            ": ",
            ": "
        ],
        "colonObj": {
            "文件后缀": [
                "头部注释冒号",
                "函数注释冒号"
            ]
        },
        "filePathColon": "路径分隔符替换",
        "showErrorMessage": false,
        "writeLog": false,
        "wideSame": true,
        "wideNum": 13,
        "functionWideNum": 13,
        "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.cursorMode": {
    
    },
    "fileheader.customMade": {
        "FilePath": "no item name",
        "Author": "xxx",
        "Description": "",
        "Date": "Do not edit",
        "LastEditTime": "Do not edit",
        "custom_string_obkoro1": "",
        "custom_string_obkoro1_copyright": "Copyright (c) ${now_year}, xxx", 
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions