当前位置:   article > 正文

VsCode 使用 koroFileHeader 配置作者信息、及函数注释_vscode怎么设置是否信任文件夹中的文件的作者、

vscode怎么设置是否信任文件夹中的文件的作者、

1、安装 koroFileHeader 插件

在这里插入图片描述

2、配置settings.json文件

左下角设置 —>设置—>输入@ext:obkoro1.korofileheader–>打开settings.json文件

还有一个快速的方法:
首选项-设置-搜索setting.json,就可以打开setting.json文件了
在这里插入图片描述
打开文件后:
修改自己想要的信息
在这里插入图片描述

{
    "fileheader.customMade": { // 此为头部注释     
        "Author": "xx", // 文件作者
        "Date": "Do not edit", // 文件创建时间
        "LastEditors": "Do not edit", // 最后编辑文件的人
        "LastEditTime": "Do not edit", // 文件最后编辑时间
        "Description": "", // 文件描述
        "FilePath": "Do not edit", // 文件在项目中的相对路径 自动更新  
    },
    "fileheader.cursorMode": { //此为函数注释
        "description":"", // 功能描述
        "param": "", // 传入参数
        "return": "", // 返回结果
        "author":"wuyue.nan" // 函数作者
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

3、在文件中实现作者的注释信息

快捷键:ctrl + win + i      // 生成头部注释
快捷键:ctrl + win + t      // 生成函数注释
  • 1
  • 2
<!--
 * @Author: xx
 * @Date: 2022-09-28 15:24:31
 * @LastEditors: Do not edit
 * @LastEditTime: 2022-11-08 09:56:16
 * @Description: www
 * @FilePath: \interface-data\src\views\systemconfig\index.vue
-->

/**
 * @description: www
 * @return {*}
 * @author: wuyue.nan
 */
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

4、配置代码自动对齐、作者信息的一套设置setting.json

{
  // Editor
  "editor.accessibilitySupport": "off",
  "editor.bracketPairColorization.enabled": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": false,
    "source.fixAll.eslint": true,
    "source.organizeImports": false
  },
  "editor.colorDecorators": true,
  "editor.columnSelection": false,
  "editor.cursorSmoothCaretAnimation": "on",
  // "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.find.addExtraSpaceOnTop": false,
  "editor.find.seedSearchStringFromSelection": "always",
  "editor.foldingStrategy": "indentation",
  "editor.formatOnPaste": false,
  "editor.glyphMargin": true,
  "editor.inlineSuggest.enabled": true,
  "editor.multiCursorModifier": "ctrlCmd",
  "editor.snippetSuggestions": "top",
  "editor.suggestSelection": "first",
  "editor.tabSize": 2,
  "editor.unicodeHighlight.allowedCharacters": {
    ":": true
  },
  "editor.unicodeHighlight.ambiguousCharacters": false,
  "editor.unicodeHighlight.invisibleCharacters": false,
  "editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?",
  "diffEditor.ignoreTrimWhitespace": false,
  // Debug
  "debug.javascript.autoAttachFilter": "disabled",
  // Explorer
  "explorer.confirmDelete": false,
  "explorer.confirmDragAndDrop": false,
  // Window
  "window.title": "${activeEditorLong}${separator}${rootName}",
  "workbench.list.smoothScrolling": true,
  "workbench.editor.highlightModifiedTabs": true,
  "breadcrumbs.enabled": false,
  "breadcrumbs.filePath": "last",
  // Files
  "files.eol": "\n",
  "files.insertFinalNewline": true,
  "files.simpleDialog.enable": true,
  // Search
  "search.followSymlinks": false,
  "search.exclude": {
    "**/.git": true,
    "**/.github": true,
    "**/.nuxt": true,
    "**/.output": true,
    "**/.pnpm": true,
    "**/.vscode": true,
    "**/.yarn": true,
    "**/bower_components": true,
    "**/dist/**": true,
    "**/logs": true,
    "**/node_modules": true,
    "**/out/**": true,
    "**/package-lock.json": true,
    "**/pnpm-lock.yaml": true,
    "**/tmp": true,
    "**/yarn.lock": true
  },
  // Extensions
  "extensions.ignoreRecommendations": true,
  "extensions.autoUpdate": "onlyEnabledExtensions",
  // Extensions - CSS
  "less.validate": false,
  "css.validate": false,
  "css.lint.unknownAtRules": "ignore",
  "css.lint.hexColorLength": "ignore",
  // Extensions - Emmet
  "emmet.showSuggestionsAsSnippets": true,
  "emmet.triggerExpansionOnTab": false,
  // Extensions - Error Lens
  "errorLens.enabledDiagnosticLevels": [
    "warning",
    "error"
  ],
  "errorLens.excludeBySource": [
    "cSpell",
    "Grammarly",
    "eslint"
  ],
  // Extensions - ESLint
  "eslint.codeAction.showDocumentation": {
    "enable": true
  },
  "eslint.quiet": true,
  "eslint.validate": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "json5"
  ],
  // Extensions - Git
  "git.enableSmartCommit": true,
  "git.confirmSync": false,
  "gitlens.hovers.enabled": false,
  "gitlens.mode.statusBar.enabled": false,
  "gitlens.codeLens.enabled": false,
  "gitlens.statusBar.enabled": false,
  // Extensions - Prettier
  "prettier.enable": false,
  "prettier.semi": false,
  "prettier.singleQuote": true,
  "prettier.bracketSameLine": true,
  "prettier.printWidth": 200,
  "prettier.trailingComma": "all",
  // Extensions - Volar
  "volar.autoCompleteRefs": false,
  "volar.codeLens.pugTools": false,
  "volar.codeLens.scriptSetupTools": true,
  "volar.preview.transparentGrid": false,
  "volar.codeLens.references": false,
  "volar.completion.preferredTagNameCase": "pascal",
  "bracketPairColorizer.depreciation-notice": false,
  // koroFileHeader
  "fileheader.customMade": {
    "Author": "XXX",
    "Date": "Do not edit",
    // "LastEditTime": "Do not edit",
    "LastEditors": "XXX",
    "Description": "description"
  },
  "[vue]": {
    "editor.defaultFormatter": "Vue.volar"
  },
  "[typescript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "vue.features.codeActions.savingTimeLimit": 1000,
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "[less]": {
    "editor.defaultFormatter": "stylelint.vscode-stylelint"
  },
  "workbench.colorTheme": "One Dark Pro",
  // 字体
  "editor.fontFamily": "Fira Code",
  "editor.fontLigatures": true,
  "[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "window.zoomLevel": 1,
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "workbench.editor.empty.hint": "hidden",
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/783243
推荐阅读
相关标签
  

闽ICP备14008679号