ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

VsCode自动生成注释

2020-03-15 19:01:39  阅读:1886  来源: 互联网

标签:false VsCode 生成 注释 vscode html editor true eslint


第一步安装插件:KoroFileHeader
第二步在setting.json中配置

  • 快捷键:

  • 文件头部注释:

    • 在当前编辑文件中使用快捷键:window:ctrl+alt+i/mac:ctrl+cmd+i,即可生成文件头部注释。
  • 函数注释:

    • 将光标放在函数行或者将光标放在函数上方的空白行
    • 使用快捷键window:ctrl+alt+t,mac:ctrl+cmd+t,即可生成函数注释。
    • 事实上,函数注释在文件的任意位置都可生成,这里需要自己控制。

核心代码:

 "fileheader.customMade": {    //此为头部注释
    "Description": "",
    "Version": "2.0",
    "Autor": "wangmiao",
    "Date": "Do not edit",
    "LastEditors": "wangmiao",
    "LastEditTime": "Do not edit"
  },
  "fileheader.cursorMode": {  //此为函数注释
    "description":"",
    "param": "",
    "return": "",
    "author":"wangmiao"
  }

效果:
在这里插入图片描述

{
  // 換行
  "editor.wordWrap": "on",
  // 是否允许自定义的snippet片段提示
  "editor.snippetSuggestions": "top",
  // vscode默认启用了根据文件类型自动设置tabsize的选项 不檢查縮進,保存后統一按設置項來設置
  "editor.detectIndentation": false,
  // 重新设定tabsize 代码缩进修改成4个空格
  "editor.tabSize": 2,
  // #每次保存的时候自动格式化
  "editor.formatOnSave": false,
  // #每次保存的时候将代码按eslint格式进行修复 使用eslint 風格使用standard 進行代碼規則限制
  "editor.fontWeight": "200",
  "editor.formatOnType": false,
  "workbench.iconTheme": "vscode-icons-mac",
  "git.confirmSync": false,
  "team.showWelcomeMessage": false,
  "window.zoomLevel": 0,
  "editor.renderWhitespace": "boundary",
  "editor.cursorBlinking": "smooth",
  "editor.minimap.enabled": true,
  "editor.minimap.renderCharacters": false,
  "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
  "editor.codeLens": true,
  //eslint 代码自动检查相关配置
  "eslint.enable": true,
  "eslint.run": "onType",
  "eslint.options": {
    "configFile": "D:/.eslintrc.js",
    "plugins": [
      "html"
    ],
    "extensions": [
      ".js",
      ".vue"
    ]
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "html",
    "vue"
  ],
  //  #让prettier使用eslint的代码格式进行校验
  "prettier.eslintIntegration": true,
  //  #去掉代码结尾的分号
  "prettier.semi": true,
  //  #使用带引号替代双引号
  "prettier.singleQuote": true,
  //  #让函数(名)和后面的括号之间加个空格
  "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
  // #这个按用户自身习惯选择  html格式化
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  // #让vue中的js按编辑器自带的ts格式进行格式化
  "vetur.format.defaultFormatter.js": "vscode-typescript",
  "explorer.confirmDelete": false,
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "force-aligned"
      // #vue组件中html代码格式化样式
    }
  },
  // 格式化stylus, 需安装Manta's Stylus Supremacy插件
  "stylusSupremacy.insertColons": false, // 是否插入冒号
  "stylusSupremacy.insertSemicolons": false, // 是否插入分好
  "stylusSupremacy.insertBraces": false, // 是否插入大括号
  "stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
  "stylusSupremacy.insertNewLineAroundBlocks": false, // 两个选择器中是否换行
  "files.associations": {
    "*.cjson": "jsonc",
    "*.wxss": "css",
    "*.wxs": "javascript"
  },
  "emmet.includeLanguages": {
    "wxml": "html"
  },
  "minapp-vscode.disableAutoConfig": true,
  "window.menuBarVisibility": "visible",
  "git.enableSmartCommit": true,
  "git.autofetch": true,
  "liveServer.settings.donotShowInfoMsg": true,
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "javascript.updateImportsOnFileMove.enabled": "always",
  "workbench.colorTheme": "SynthWave '84",
  // 字體大小
  "editor.fontSize": 15,
  // 設置行高
  "editor.lineHeight": 20,
  "search.followSymlinks": false,
  "workbench.sideBar.location": "left",
  "vscode_custom_css.policy": true,
  "vscode_custom_css.imports": [
    "file:///C:/vscode-transparent/synthwave84.css",
    "file:///C:/vscode-transparent/toolbar.css",
    "file:///C:/vscode-transparent/vscode-vibrancy-style.css",
    "file:///C:/vscode-transparent/enable-electron-vibrancy.js"
  ],
  // 高亮的颜色,emm暂时只支持这样写
  "wxmlConfig.activeColor": {
    "color": "#e5c07b"
  },
  // 是否禁用高亮组件
  "wxmlConfig.activeDisable": false,
  // 是否开启保存自动格式化
  "wxmlConfig.onSaveFormat": false,
  "wxmlConfig.format": {
    "brace_style": "collapse",
    "end_with_newline": false,
    "indent_char": "",
    "indent_handlebars": false,
    "indent_inner_html": false,
    "indent_scripts": "keep",
    "indent_size": 2,
    "indent_with_tabs": false,
    "max_preserve_newlines": 1,
    "preserve_newlines": false,
    "wrap_attributes": "force-expand-multiline"
  },
  // 高亮所忽略的组件数组
  "wxmlConfig.tagNoActiveArr": [
    "view",
    "button",
    "text",
    "icon",
    "image",
    "navigator",
    "block",
    "input",
    "template",
    "form",
    "camera",
    "textarea"
  ],
  "zenMode.restore": true,
  "breadcrumbs.enabled": true,
  "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
  "[wxml]": {
    "editor.defaultFormatter": "qiu8310.minapp-vscode"
  },
  "gitlens.advanced.messages": {
    "suppressLineUncommittedWarning": true
  },
  "javascript.format.placeOpenBraceOnNewLineForControlBlocks": true,
  "editor.formatOnPaste": false,
  "vsicons.presets.hideFolders": true,
  "editor.cursorStyle": "line-thin",
  "editor.suggestSelection": "first",
  "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "terminal.integrated.rendererType": "dom",
  "vscode_vibrancy.opacity": 1,
  "npm.fetchOnlinePackageInfo": false,
  "fileheader.customMade": {    //此为头部注释
    "Description": "",
    "Version": "2.0",
    "Autor": "wangmiao",
    "Date": "Do not edit",
    "LastEditors": "wangmiao",
    "LastEditTime": "Do not edit"
  },
  "fileheader.cursorMode": {  //此为函数注释
    "description":"",
    "param": "",
    "return": "",
    "Date": "Do not edit",
    "author":"wangmiao",
    "LastEditors": "wangmiao",
    "LastEditTime": "Do not edit"
  }
}

标签:false,VsCode,生成,注释,vscode,html,editor,true,eslint
来源: https://blog.csdn.net/weixin_43764814/article/details/104883558

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有