【VSCode】【LTS】settings.json

目录

一. 问题

二. 配置

2.1 Python Settings

2.2 Text Settings

2.3 Deprecated

2.4 Global Settings

三. 日期

3.1 2021.06

3.1.1 工程配置

3.1.2 Python 项目配置

3.2  2021.07

3.2.1 工程配置

3.1.2 Python 项目配置

四. 参考


一. 问题

最近一直在用VSCode 写代码,发现网上对这个settings.json 文件解释配置项褒贬不一,各个地方都是粘贴复制一点的;现在简单汇总一下后续持续更新中;

严重吐槽:

1. VSCode 更新太频繁;

2. 之前好好的配置,后续停下几个版本后,继续回来使用,就都得或多或少的更新配置;

3. VSCode 自动格式化,使用有些第三方插件,有时候配置项是冲突的,莫名其妙的就会导致格式化失效;

二. 配置

2.1 Python Settings

用户工作空间自定义配置项(Python 推荐):

{
    "editor.tabSize": 4,
    "editor.detectIndentation": false,
    // "debug.toolBarLocation": "docked",
    "editor.suggestSelection": "first",
    "editor.fontSize": 14,
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "editor.wordWrapColumn": 250,
    "editor.columnSelection": false,
    "editor.mouseWheelZoom": true,
    "explorer.confirmDelete": false,
    "editor.renderWhitespace": "all",
    "editor.renderControlCharacters": true,
    "editor.suggest.shareSuggestSelections": true,
    "editor.renderIndentGuides": false,
    "debug.console.fontSize": 14,
    "git.autofetch": true,
    "[json]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[jsonc]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "terminal.integrated.fontSize": 14,
    "markdown.extension.toc.githubCompatibility": true,
    "markdownlint.config": {
        "MD033": false,
        "MD034": false,
    },
    "markdown.extension.katex.macros": {},
    "markdown.extension.toc.levels": "2..6",
    "markdown-pdf.highlightStyle": "github.css",
    // "markdown-pdf.headerTemplate":"<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \"> <span class='date'></span></div>",
    "markdown-pdf.headerTemplate": "<div></div>",
    "terminal.integrated.copyOnSelection": true,
    // "files.autoSave": "afterDelay",
    "files.insertFinalNewline": true,
    "files.autoGuessEncoding": true,
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true
    },
    "python.analysis.logLevel": "Trace",
    "python.analysis.watchSearchPaths": true,
    "python.autoComplete.extraPaths": [
        "./src",
        "./mock",
        "./test",
        "./venv2/bin",
        "./venv2/Lib/python2.7/site-packages",
        // "./venv/bin",
        // "./venv/Lib/python3.7/site-packages",
    ],
    "python.pythonPath": "venv2/bin/python",
    "python.formatting.provider": "yapf",
    "python.languageServer": "Microsoft",
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": ["--max-line-length=250"],
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        ".",
        "-p",
        "test_*.py"
    ],
    "python.testing.autoTestDiscoverOnSaveEnabled": true,
    "python.testing.cwd": "${workspaceFolder}",
    "python.testing.nosetestsEnabled": false,
    "python.testing.pytestEnabled": false,
    "python.testing.unittestEnabled": true,
    "workbench.iconTheme": "vscode-icons",
    "workbench.editor.enablePreview": true,
    "workbench.editor.enablePreviewFromQuickOpen": true,
    "window.zoomLevel": 0,
}

2.2 Text Settings

用户工作空间自定义配置项(推荐)

{
    "editor.tabSize": 4,
    "editor.detectIndentation": false,
    // "debug.toolBarLocation": "docked",
    "editor.suggestSelection": "first",
    "editor.fontSize": 14,
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "editor.wordWrapColumn": 250,
    "editor.columnSelection": false,
    "editor.mouseWheelZoom": true,
    "explorer.confirmDelete": false,
    "editor.renderWhitespace": "all",
    "editor.renderControlCharacters": true,
    "editor.suggest.shareSuggestSelections": true,
    "editor.renderIndentGuides": false,
    "debug.console.fontSize": 14,
    // "files.autoSave": "afterDelay",
    "files.insertFinalNewline": true,
    "files.autoGuessEncoding": true,
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true
    },
    "git.autofetch": true,
    "[json]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[jsonc]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "terminal.integrated.fontSize": 14,
    "markdown.extension.toc.githubCompatibility": true,
    "markdownlint.config": {
        "MD033": false,
        "MD034": false
    },
    "markdown.extension.katex.macros": {},
    "markdown.extension.toc.levels": "2..6",
    "markdown-pdf.highlightStyle": "github.css",
    // "markdown-pdf.headerTemplate":"<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \"> <span class='date'></span></div>",
    "markdown-pdf.headerTemplate": "<div></div>",
    "terminal.integrated.copyOnSelection": true,
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "workbench.iconTheme": "vscode-icons",
    "workbench.editor.enablePreview": true,
    "workbench.editor.enablePreviewFromQuickOpen": true,
    "window.zoomLevel": 0,
}

2.3 Deprecated

用户工作空间配置项一(设置 -> 用户 -> 常用设置 -> Files: Associations 在settings.json 中编辑):

{
    "editor.fontSize": 24,
    "git.autofetch": true,
    "editor.wordWrapColumn": 120,
    "workbench.iconTheme": "vscode-icons",
    "files.exclude": {
        "**/.classpath": true,
        "**/.factorypath": true,
        "**/.project": true,
        "**/.pyc": true,
        "**/.settings": true
    },
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "editor.renderWhitespace": "all",
    "[jsonc]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "files.autoGuessEncoding": true,
    "[python]": {},
    "terminal.integrated.fontSize": 14,
    "debug.console.fontSize": 14,
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "[json]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "scm.defaultViewMode": "tree",
    "scm.alwaysShowActions": true,
    "editor.renderControlCharacters": true,
    "editor.renderIndentGuides": false,
    "files.autoSave": "afterDelay",
    "workbench.sideBar.location": "left",
    "breadcrumbs.symbolSortOrder": "type",
    "window.zoomLevel": 1,
    "python.jediMemoryLimit": 1024,
    "python.jediEnabled": false,
    // "terminal.integrated.shell.osx": "/usr/local/bin/fish",
    // "terminal.integrated.automationShell.osx": "/bin/sh"
}

2.4 Global Settings

配置VSCode 全局配置(不建议):

/Users/XXX/Library/Application Support/Code/User/settings.json

{
    "breadcrumbs.symbolSortOrder": "type",
    "editor.columnSelection": false,
    "editor.detectIndentation": false,
    "editor.fontSize": 24,
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "editor.wordWrapColumn": 250,
    "editor.renderControlCharacters": true,
    "editor.renderIndentGuides": false,
    "editor.renderWhitespace": "all",
    "editor.suggestSelection": "first",
    "editor.suggest.shareSuggestSelections": true,
    "editor.mouseWheelZoom": true,
    "editor.tabSize": 4,
    "explorer.confirmDelete": false,
    "code-runner.clearPreviousOutput": true,
    "code-runner.temporaryFileName": "dvsnier",
    "code-runner.saveAllFilesBeforeRun": true,
    "code-runner.saveFileBeforeRun": true,
    "debug.console.fontSize": 14,
    // "debug.toolBarLocation": "docked",
    "diffEditor.renderSideBySide": false,
    // "files.autoSave": "afterDelay",
    "files.autoGuessEncoding": true,
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true,
        "**/*.pyo": true,
        "**/.classpath": true,
        "**/.factorypath": true,
        "**/.project": true,
        "**/.settings": true
    },
    "files.insertFinalNewline": true,
    "git.autofetch": true,
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[json]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[jsonc]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    
    "markdown.extension.toc.githubCompatibility": true,
    "markdown.extension.katex.macros": {
    },
    "markdown.extension.toc.levels": "2..6",
    "markdownlint.config": {
        "MD033": false,
        "MD034": false
    },
    "markdown-pdf.highlightStyle": "github.css",
    // "markdown-pdf.headerTemplate":"<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \"> <span class='date'></span></div>",
    "markdown-pdf.headerTemplate": "<div></div>",


    "python.dataScience.sendSelectionToInteractiveWindow": true,
    "python.jediMemoryLimit": 1024,
    "python.jediEnabled": false,
    "python.analysis.logLevel": "Trace",
    "python.analysis.watchSearchPaths": true,
    "python.autoComplete.extraPaths": [
        "./src",
        "./mock",
        "./test",
        "./venv2/bin",
        "./venv2/Lib/python2.7/site-packages",
        // "./venv/bin",
        // "./venv/Lib/python3.7/site-packages",
    ],
    "python.pythonPath": "venv2/bin/python",
    "python.formatting.provider": "yapf",
    "python.languageServer": "Microsoft",
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": ["--max-line-length=250"],
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        ".",
        "-p",
        "test_*.py"
    ],
    "python.testing.autoTestDiscoverOnSaveEnabled": true,
    "python.testing.cwd": "${workspaceFolder}",
    "python.testing.nosetestsEnabled": false,
    "python.testing.pytestEnabled": false,
    "python.testing.unittestEnabled": true,

    "scm.defaultViewMode": "tree",
    "scm.alwaysShowActions": true,
    // "terminal.integrated.automationShell.osx": "/bin/sh"
    "terminal.integrated.copyOnSelection": true,
    "terminal.integrated.fontSize": 14,
    // "terminal.integrated.shell.osx": "/usr/local/bin/fish",


    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "workbench.editor.enablePreview": true,
    "workbench.editor.enablePreviewFromQuickOpen": true,
    "workbench.iconTheme": "vscode-icons",
    "workbench.sideBar.location": "left",
    "window.zoomLevel": 0,
}

三. 日期

现在发现插件多了,问题越来越多,把通用工程配置项目配置分割开来;

3.1 2021.06

3.1.1 工程配置

通用工程配置细节:

{
    "breadcrumbs.symbolSortOrder": "type",
    "editor.formatOnType": true,
    "editor.codeActionsOnSave": [
        "editor.action.formatDocument"
    ],
    "editor.tabSize": 4,
    "editor.detectIndentation": false,
    "editor.suggestSelection": "first",
    "editor.fontSize": 14,
    "editor.fontLigatures": false,
    "editor.formatOnSave": true,
    // "editor.formatOnType": true,
    "editor.wordWrap": "wordWrapColumn",
    "editor.wordWrapColumn": 140,
    "editor.columnSelection": false,
    "editor.mouseWheelZoom": false,
    "editor.renderWhitespace": "all",
    "editor.renderControlCharacters": true,
    "editor.suggest.shareSuggestSelections": true,
    "editor.renderIndentGuides": true,
    "editor.rulers": [
        80,
        100,
        120,
        140
    ],
    "explorer.confirmDelete": false,
    // "debug.toolBarLocation": "docked",
    "debug.console.fontSize": 14,
    // "files.autoSave": "afterDelay",
    "files.insertFinalNewline": true,
    "files.autoGuessEncoding": true,
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true,
        "**/__pycache__": true,
    },
    "git.autofetch": true,
    "git.confirmSync": false,
    // 替换成本地存储路径
    // "hediet.vscode-drawio.local-storage": "",
    "python.logging.level": "debug",
    // "markdown.extension.toc.githubCompatibility": true,
    "markdownlint.config": {
        "MD033": false,
        "MD034": false,
    },
    "markdown.extension.katex.macros": {},
    "markdown.extension.toc.levels": "2..6",
    "markdown-pdf.highlightStyle": "github.css",
    // "markdown-pdf.headerTemplate":"<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \"> <span class='date'></span></div>",
    "markdown-pdf.headerTemplate": "<div></div>",
    "scm.defaultViewMode": "tree",
    "scm.alwaysShowActions": true,
    "workbench.iconTheme": "vscode-icons",
    "workbench.editor.enablePreview": true,
    "workbench.editor.enablePreviewFromQuickOpen": true,
    "window.zoomLevel": 0,
    "workbench.sideBar.location": "left",
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],
    "terminal.integrated.copyOnSelection": true,
    "terminal.integrated.fontSize": 14,
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "bash"
        },
        "zsh": {
            "path": "zsh"
        },
        "fish": {
            "path": "fish"
        },
        "tmux": {
            "path": "tmux",
            "icon": "terminal-tmux"
        },
        "pwsh": {
            "path": "pwsh",
            "icon": "terminal-powershell"
        }
    },
}

3.1.2 Python 项目配置

Python 配置细节:

{
    "[python]": {
        "editor.defaultFormatter": "ms-python.python"
    },
    // "python.analysis.extraPaths": [
    //     "./src",
    //     "./mock",
    //     "./test",
    //     // darwin
    //     "./venv2/bin",
    //     "./venv2/lib/python2.7/site-packages",
    //     "./venv/bin",
    //     "./venv/lib/python3.7/site-packages",
    //     // win32
    //     "./venv2/Scripts",
    //     "./venv2/Lib/site-packages",
    //     "./venv/Scripts",
    //     "./venv/Lib/site-packages",
    // ],
    "python.analysis.logLevel": "Trace",
    // "python.analysis.watchSearchPaths": true,
    "python.analysis.typeCheckingMode": "basic",
    // "python.analysis.typeCheckingMode": "strict",
    "python.analysis.diagnosticMode": "openFilesOnly",
    // https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md
    "python.analysis.diagnosticSeverityOverrides": {},
    "python.analysis.useLibraryCodeForTypes": true,
    "python.analysis.autoImportCompletions": true,
    "python.autoComplete.addBrackets": true,
    "python.analysis.completeFunctionParens": true,
    // "python.autoComplete.addBrackets": false,
    // "python.analysis.completeFunctionParens": false,
    // "python.autoComplete.extraPaths": [
    //     "./src",
    //     "./mock",
    //     "./tests",
    //     // darwin
    //     "./venv2/bin",
    //     "./venv2/lib/python2.7/site-packages",
    //     "./venv/bin",
    //     "./venv/lib/python3.7/site-packages",
    //     // win32
    //     "./venv2/Scripts",
    //     "./venv2/Lib/site-packages",
    //     "./venv/Scripts",
    //     "./venv/Lib/site-packages",
    // ],
    // "python.autoUpdateLanguageServer": true,
    // "python.defaultInterpreterPath": "${workspaceFolder}/venv2/bin/python",
    // "python.defaultInterpreterPath": "venv2/bin/python",
    // "python.diagnostics.sourceMapsEnabled": true,
    "python.envFile": "${workspaceFolder}/.env",
    // "python.pythonPath": "${workspaceFolder}/venv2/bin/python",
    // "python.pythonPath": "venv2/bin/python",
    // "python.pythonPath": "venv2\\Scripts\\python.exe",
    "python.formatting.provider": "yapf",
    // "python.formatting.yapfArgs": [
    //     "--style",
    //     "{based_on_style: pep8, indent_width: 4}"
    // ],
    "python.formatting.yapfArgs": [
        "--style",
        "{based_on_style: pep8 ,indent_width: 4, column_limit: 120}",
    ],
    // "python.languageServer": "Jedi",
    "python.languageServer": "Pylance",
    // "python.languageServer": "Microsoft",
    // "python.logging.level": "info",
    "python.linting.enabled": true,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--max-line-length=140",
        // "--ignore=E251",
        "--verbose",
    ],
    "python.linting.ignorePatterns": [
        ".vscode/*.py",
        "**/site-packages/**/*.py"
    ],
    "python.linting.lintOnSave": true,
    "python.linting.pylintEnabled": false,
    // https://github.com/microsoft/vscode-python/discussions/15997#discussioncomment-636389
    // "python.testing.unittestArgs": [
    //     "-v",
    //     "-s",
    //     ".",
    //     "-p",
    //     "test_*.py"
    // ],
    // "python.testing.autoTestDiscoverOnSaveEnabled": true,
    "python.testing.cwd": "${workspaceFolder}",
    "python.testing.nosetestsEnabled": false,
    "python.testing.pytestEnabled": false,
    "python.testing.promptToConfigure": false,
    "python.testing.unittestEnabled": true,
    // "workbench.settings.openDefaultSettings": true,
    // "workbench.settings.editor": "ui",
    // "workbench.settings.openDefaultKeybindings": true,
    // "workbench.settings.useSplitJSON": true,
}

3.2  2021.07

3.2.1 工程配置

通用工程配置细节:

{
    "breadcrumbs.symbolSortOrder": "type",
    "editor.formatOnType": true,
    "editor.codeActionsOnSave": [
        "editor.action.formatDocument"
    ],
    "editor.tabSize": 4,
    "editor.detectIndentation": false,
    "editor.suggestSelection": "first",
    "editor.fontSize": 14,
    "editor.fontLigatures": false,
    "editor.formatOnSave": true,
    // "editor.formatOnType": true,
    "editor.wordWrap": "wordWrapColumn",
    "editor.wordWrapColumn": 140,
    "editor.columnSelection": false,
    "editor.mouseWheelZoom": false,
    "editor.renderWhitespace": "all",
    "editor.renderControlCharacters": true,
    "editor.suggest.shareSuggestSelections": true,
    "editor.renderIndentGuides": true,
    "editor.rulers": [
        80,
        100,
        120,
        140
    ],
    "explorer.confirmDelete": false,
    "extensions.autoUpdate": false,
    // "debug.toolBarLocation": "docked",
    "debug.console.fontSize": 14,
    // "files.autoSave": "afterDelay",
    "files.insertFinalNewline": true,
    "files.autoGuessEncoding": true,
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true,
        "**/__pycache__": true,
    },
    "git.autofetch": true,
    "git.confirmSync": false,
    // "guides.enabled": true,
    // the darwin default interpreter Path
    // "python.defaultInterpreterPath": "${workspaceFolder}/venv2/bin/python",
    // the win32 default interpreter Path
    // "python.defaultInterpreterPath": "${workspaceFolder}\\venv2\\Scripts\\python.exe",
    // https://github.com/microsoft/vscode-python/wiki/AB-Experiments
    "python.experiments.enabled": true,
    "python.experiments.optInto": [
        // "pythonDeprecatePythonPath",
        // "pythonTensorboardExperiment",
        // "pythonDiscoveryModule",
        // "pythonDiscoveryModuleWithoutWatcher",
        // "pythonJediLSP",
        // "pythonSurveyNotification",
        "All"
    ],
    "python.experiments.optOutFrom": [
        // "pythonDeprecatePythonPath",
        // "pythonTensorboardExperiment",
        // "pythonDiscoveryModule",
        // "pythonDiscoveryModuleWithoutWatcher",
        // "pythonJediLSP",
        // "pythonSurveyNotification",
        // "All"
    ],
    "python.logging.level": "debug",
    "python.venvFolders": [
        "${workspaceFolder}/venv2",
        "${workspaceFolder}/venv"
    ],
    "python.venvPath": "${workspaceFolder}/venv2",
    // "markdown.extension.toc.githubCompatibility": true,
    "markdownlint.config": {
        "MD033": false,
        "MD034": false,
    },
    "markdown.extension.katex.macros": {},
    "markdown.extension.toc.levels": "2..6",
    "markdown-pdf.highlightStyle": "github.css",
    // "markdown-pdf.headerTemplate":"<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \"> <span class='date'></span></div>",
    "markdown-pdf.headerTemplate": "<div></div>",
    "scm.defaultViewMode": "tree",
    "scm.alwaysShowActions": true,
    "workbench.iconTheme": "vscode-icons",
    "workbench.editor.enablePreview": true,
    "workbench.editor.enablePreviewFromQuickOpen": true,
    "window.zoomLevel": 0,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter.notebook.ipynb"
    },
    // "workbench.sideBar.location": "left",
    // "workbench.settings.openDefaultKeybindings": true,
    // "workbench.settings.openDefaultSettings": true,
    // "workbench.settings.useSplitJSON": true,
    "terminal.integrated.copyOnSelection": true,
    "terminal.integrated.fontSize": 14,
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "bash"
        },
        "zsh": {
            "path": "zsh"
        },
        "fish": {
            "path": "fish"
        },
        "tmux": {
            "path": "tmux",
            "icon": "terminal-tmux"
        },
        "pwsh": {
            "path": "pwsh",
            "icon": "terminal-powershell"
        }
    },
}

3.1.2 Python 项目配置

Python 配置细节:

{
    "[python]": {
        "editor.defaultFormatter": "ms-python.python"
    },
    // "python.analysis.extraPaths": [
    //     "./src",
    //     "./mock",
    //     "./test",
    //     // darwin
    //     "./venv2/bin",
    //     "./venv2/lib/python2.7/site-packages",
    //     "./venv/bin",
    //     "./venv/lib/python3.7/site-packages",
    //     // win32
    //     "./venv2/Scripts",
    //     "./venv2/Lib/site-packages",
    //     "./venv/Scripts",
    //     "./venv/Lib/site-packages",
    // ],
    "python.analysis.logLevel": "Trace",
    // "python.analysis.watchSearchPaths": true,
    "python.analysis.typeCheckingMode": "basic",
    // "python.analysis.typeCheckingMode": "strict",
    "python.analysis.diagnosticMode": "openFilesOnly",
    // https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md
    "python.analysis.diagnosticSeverityOverrides": {},
    "python.analysis.useLibraryCodeForTypes": true,
    "python.analysis.autoImportCompletions": true,
    "python.autoComplete.addBrackets": true,
    "python.analysis.completeFunctionParens": true,
    // "python.autoComplete.addBrackets": false,
    // "python.analysis.completeFunctionParens": false,
    // https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance#settings-and-customization
    // "python.autoComplete.extraPaths": [
    //     "./src",
    //     "./mock",
    //     "./tests",
    //     // darwin
    //     "./venv2/bin",
    //     "./venv2/lib/python2.7/site-packages",
    //     "./venv/bin",
    //     "./venv/lib/python3.7/site-packages",
    //     // win32
    //     "./venv2/Scripts",
    //     "./venv2/Lib/site-packages",
    //     "./venv/Scripts",
    //     "./venv/Lib/site-packages",
    // ],
    // "python.autoUpdateLanguageServer": true,
    // "python.defaultInterpreterPath": "${workspaceFolder}/venv2/bin/python",
    // "python.defaultInterpreterPath": "venv2/bin/python",
    // "python.diagnostics.sourceMapsEnabled": true,
    "python.envFile": "${workspaceFolder}/.env",
    // "python.pythonPath": "${workspaceFolder}/venv2/bin/python",
    // "python.pythonPath": "venv2/bin/python",
    // "python.pythonPath": "venv2\\Scripts\\python.exe",
    "python.formatting.provider": "yapf",
    // "python.formatting.yapfArgs": [
    //     "--style",
    //     "{based_on_style: pep8, indent_width: 4}"
    // ],
    "python.formatting.yapfArgs": [
        "--style",
        "{based_on_style: pep8 ,indent_width: 4, column_limit: 120}",
    ],
    // "python.languageServer": "Jedi",
    "python.languageServer": "Pylance",
    // "python.languageServer": "Microsoft",
    // "python.logging.level": "info",
    "python.linting.enabled": true,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--max-line-length=140",
        // "--ignore=E251",
        "--verbose",
    ],
    "python.linting.ignorePatterns": [
        ".vscode/*.py",
        "**/site-packages/**/*.py"
    ],
    "python.linting.lintOnSave": true,
    "python.linting.pylintEnabled": false,
    // https://github.com/microsoft/vscode-python/discussions/15997#discussioncomment-636389
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        ".",
        "-p",
        "test_*.py"
    ],
    // "python.testing.autoTestDiscoverOnSaveEnabled": true,
    "python.testing.cwd": "${workspaceFolder}",
    "python.testing.nosetestsEnabled": false,
    "python.testing.pytestEnabled": false,
    "python.testing.promptToConfigure": false,
    "python.testing.unittestEnabled": true,
    // "workbench.settings.openDefaultSettings": true,
    // "workbench.settings.editor": "ui",
    // "workbench.settings.openDefaultKeybindings": true,
    // "workbench.settings.useSplitJSON": true,
}

四. 参考

  1. User and Workspace Settings;
  2. Editing JSON with Visual Studio Code;
  3. Python settings reference;
  4. VS Code 有哪些必不可少的设置项?
  5. Visual Studio Code
  6. 通过配置 VS Code 来提高生产力;
  7. https://blog.csdn.net/DovSnier/article/details/86418994
  8. https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings
  9. https://github.com/microsoft/vscode-python/blob/main/CHANGELOG.md

(完)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值