{ "files.associations": { "cctype": "cpp", "clocale": "cpp", "cmath": "cpp", "csignal": "cpp", "cstdarg": "cpp", "cstddef": "cpp", "cstdio": "cpp", "cstdlib": "cpp", "cstring": "cpp", "ctime": "cpp", "cwchar": "cpp", "cwctype": "cpp", "any": "cpp", "array": "cpp", "atomic": "cpp", "bit": "cpp", "bitset": "cpp", "chrono": "cpp", "codecvt": "cpp", "compare": "cpp", "complex": "cpp", "concepts": "cpp", "condition_variable": "cpp", "coroutine": "cpp", "cstdint": "cpp", "deque": "cpp", "list": "cpp", "map": "cpp", "set": "cpp", "string": "cpp", "unordered_map": "cpp", "vector": "cpp", "exception": "cpp", "algorithm": "cpp", "functional": "cpp", "iterator": "cpp", "memory": "cpp", "memory_resource": "cpp", "numeric": "cpp", "optional": "cpp", "random": "cpp", "ratio": "cpp", "regex": "cpp", "source_location": "cpp", "string_view": "cpp", "system_error": "cpp", "tuple": "cpp", "type_traits": "cpp", "utility": "cpp", "fstream": "cpp", "future": "cpp", "initializer_list": "cpp", "iomanip": "cpp", "iosfwd": "cpp", "iostream": "cpp", "istream": "cpp", "limits": "cpp", "mutex": "cpp", "new": "cpp", "numbers": "cpp", "ostream": "cpp", "semaphore": "cpp", "sstream": "cpp", "stdexcept": "cpp", "stop_token": "cpp", "streambuf": "cpp", "thread": "cpp", "cinttypes": "cpp", "typeindex": "cpp", "typeinfo": "cpp", "variant": "cpp", "forward_list": "cpp", "ranges": "cpp", "valarray": "cpp", "charconv": "cpp", "unordered_set": "cpp", "shared_mutex": "cpp", "*.bak": "cpp", }, // --- 全局核心风格配置 --- // 强制使用 Tab,严禁空格 "editor.insertSpaces": false, "editor.tabSize": 4, "editor.detectIndentation": false, // 防止打开非标文件时被带偏 // 行宽 100 字符辅助线 "editor.rulers": [], "editor.wordWrapColumn": 100, "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.organizeImports": "explicit" }, // --- Python 配置 (关键修改) --- "[python]": { // 替换 Black 为 Autopep8 (因为 Black 不支持 Tab) "editor.defaultFormatter": "ms-python.autopep8", "editor.insertSpaces": false, "editor.tabSize": 4 }, // Autopep8 参数:强制 100 字符行宽,允许 Tab "autopep8.args": [ "--max-line-length", "100", "--ignore", "E121" // 忽略部分缩进对齐警告 ], // Pylint 参数:指定配置文件路径 "pylint.args": [ "--rcfile=${workspaceFolder}/.pylintrc" ], // Python 环境管理 (保留您原有的设置) "python-envs.defaultEnvManager": "ms-python.python:system", "python-envs.defaultPackageManager": "ms-python.python:pip", "python-envs.pythonProjects": [], // --- C++ 配置 --- // 读取根目录的 .clang-format 文件 (Tab, K&B, BigCamel 等规则由此文件控制) "C_Cpp.clang_format_style": "file", // --- JavaScript / TypeScript 配置 --- "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.insertSpaces": false, // 覆盖 Prettier 默认的 Space "editor.tabSize": 4, "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" } }, "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.insertSpaces": false, // 覆盖 Prettier 默认的 Space "editor.tabSize": 4, "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" } }, // 注意:Prettier 通常优先读取 .prettierrc 文件。 // 如果您有 .prettierrc,请务必在其中设置 "useTabs": true, "tabWidth": 4 // --- JSON 配置 --- "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" } }