OBKoro1 / koro1FileHeader

VSCode插件:自动生成,自动更新VSCode文件头部注释, 自动生成函数注释并支持提取函数参数,支持所有主流语言,文档齐全,使用简单,配置灵活方便,持续维护多年。
MIT License
5.65k stars 274 forks source link

bug:custom_string_obkoro自定义字段在python文件中异常 #321

Closed VivianKeith closed 3 years ago

VivianKeith commented 3 years ago

注意:

  1. 可以先试一下常见问题中的方法.
  2. 然后搜一搜以前关闭的issue看有没有相似的问题可以帮助解决问题。
  3. 打开fileheader.configObj.showErrorMessage看看没有没有报错信息
  4. issue提的越清晰,越容易定位问题/找到bug,越快速的解决问题。

描述bug(必填) 最新版插件(4.8.6):custom_string_obkoro1~100, custom_string_obkoro1_copyright, custom_string_obkoro1_date在python文件中异常。问题同以下两个issue:

249 #261

注释设置(必填):

{
    "python.pythonPath": "D:\\Python\\Python37\\python.exe",
    "[json]": {},
    "[cpp]": {},
    "C_Cpp.updateChannel": "Insiders",
    "editor.fontFamily": "Fira Code, Cascadia Code, Consolas, 'Courier New', monospace, 'DejaVu Sans Mono for Powerline','Meslo LG M for powerLine'",
    "terminal.integrated.fontFamily": " ‘Cascadia Code’,Consolas, 'Courier New', monospace,'DejaVu Sans Mono for Powerline','Meslo LG M for powerLine'",
    "http.proxySupport": "off",
    "terminal.integrated.shell.linux": "/bin/zsh",
    "editor.fontLigatures": true,
    "todo-tree.tree.showScanModeButton": false,
    "remote.SSH.remotePlatform": {
        "Astlab-Server(Huawei)": "linux",
        "ASTLAB-Server(Huawei)": "linux",
        "Astlab-Server(HP)": "linux",
        "BUAA-HPC(Lini)": "linux",
        "Astlab-Server(Huawei-68)": "linux",
        "Astlab-Server(Huawei-104)": "linux"
    },
    "jupyter.sendSelectionToInteractiveWindow": true,
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],
    "workbench.iconTheme": "material-icon-theme",
    "workbench.colorTheme": "One Dark Pro",
    "leetcode.endpoint": "leetcode-cn",
    "leetcode.workspaceFolder": "e:\\Research\\PhD\\DevWorkspace\\Hands-on-Algorithm\\Crack_LeetCode",
    "settingsSync.ignoredSettings": [
        "editor.fontFamily",
        "editor.fontSize",
        "terminal.integrated.fontFamily"
    ],
    "editor.fontSize": 15,
    "terminal.integrated.env.osx": {
        "PATH": ""
    },
    "fileheader.configObj": {

        "createFileTime": true,
        "language": {
            "languagetest": {
                "head": "/$$",
                "middle": " $ @",
                "end": " $/"
            }
        },
        "autoAdd": false,
        "autoAddLine": 100,
        "autoAlready": true,
        "annotationStr": {
            "head": "/*",
            "middle": " * @",
            "end": " */",
            "use": false
        },
        "headInsertLine": {
            "php": 2,
            "sh": 2
        },
        "beforeAnnotation": {
            "文件后缀": "该文件后缀的头部注释之前添加某些内容",
            "py": "# coding=utf-8"
        },
        "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": true,
        "wideNum": 13,
        "functionWideNum": 0,
        "CheckFileChange": false,
        "createHeader": false,
        "useWorker": false,
        "designAddHead": false,
        "headDesignName": "random",
        "headDesign": false,
        "cursorModeInternal": false,
        "openFunctionParamsCheck": true,
        "functionParamsShape": "normal"
    },
    "fileheader.customMade": {
        "Description": "",
        "Author": "Vivian Keith",
        "Date": "Do not edit",
        "LastEditTime": "Do not edit",
        "LastEditors": "Vivian Keith",
        "FilePath": "Do not edit",
        "custom_string_obkoro1_copyright": "Copyright (c) Vivian Keith",
        "custom_string_obkoro1_date": "Do not edit",
        "custom_string_obkoro1": "可以输入预定的版权声明、个性签名、空行等"
    },
    "fileheader.cursorMode": {

    }
}

VsCode设置:

文件后缀(必填): .py

如:test.js 的后缀为 js

你得到的注释(必填):

你生成的注释为:

# coding=utf-8
'''
Description  : 
Author       : Vivian Keith
Date         : 2021-05-13 15:16:24
LastEditTime : 2021-05-13 17:45:44
LastEditors  : Vivian Keith
FilePath     : /Reinforcement-learning-with-tensorflow/testtest.py
symbol_custom_string_obkoro10001: Copyright (c) Vivian Keith
symbol_custom_string_obkoro10000: 2021-05-13 15:16:24
symbol_custom_string_obkoro1: 可以输入预定的版权声明、个性签名、空行等
'''

预期的行为(必填):

预期得到的注释/行为:

# coding=utf-8
'''
Description  : 
Author       : Vivian Keith
Date         : 2021-05-13 15:16:24
LastEditTime : 2021-05-13 17:45:44
LastEditors  : Vivian Keith
FilePath     : /Reinforcement-learning-with-tensorflow/testtest.py
Copyright (c) Vivian Keith
2021-05-13 15:16:24
可以输入预定的版权声明、个性签名、空行等
'''

错误日志(选填):

{
    "resource": "/C:/Users/VivianKeith/AppData/Roaming/Code/User/settings.json",
    "owner": "_generated_diagnostic_collection_name_#0",
    "code": "768",
    "severity": 4,
    "message": "Problems loading reference 'https://raw.githubusercontent.com/streetsidesoftware/cspell/cspell-lib%404.3.4/cspell.schema.json#/definitions/OverrideSettings': Unable to load schema from 'https://raw.githubusercontent.com/streetsidesoftware/cspell/cspell-lib%404.3.4/cspell.schema.json': Request vscode/content failed unexpectedly without providing any details.",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 1,
    "endColumn": 2
}

怎么生成错误日志?

屏幕截图(选填) d7eff553bc3ae34b73f61fc0956b756 39925c9c810b1f45e04f5f27aada2a3

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

问题相关(选填) 在这里添加关于这个问题的任何其他上下文。 插件版本为最新版:4.8.6 VS Code 版本:1.56.1 操作系统:Windows 10 20H2 x64

OBKoro1 commented 3 years ago

更新插件 此问题已修复。