返回博客
2026年5月29日26 阅读2 分钟阅读开发者

.vscode/settings.json设置解析器

{ "files.watcherExclude": { "**/venv/**": true, "**/.venv/**": true, "**/env/**": true...

IDE 中在项目目录下的.vscode/settings.json中可以配置参数,包括自动激活虚拟环境,但要记得现在虚拟环境配置与插件 python Environments有冲突,先禁用即可。 同时最好安装扩展: Prettier - Code formatter Black Formatter


      
{
  "python.defaultInterpreterPath": "/home/lyh/dev/venv/bin/python",
  "python.terminal.activateEnvironment": true,
  "python.condaActivateEnvironment": false,
  "files.watcherExclude": {
    "**/venv/**": true,
    "**/.venv/**": true,
    "**/env/**": true,
    "**/node_modules/**": true,
    "**/.pnpm-store/**": true,
    "**/.git/**": true,
    "**/__pycache__/**": true,
    "**/*.py[cod]": true,
    "**/*$py.class": true,
    "**/.mypy_cache/**": true,
    "**/.ruff_cache/**": true,
    "**/.pytest_cache/**": true,
    "**/dist/**": true,
    "**/dev-dist/**": true,
    "**/build/**": true,
    "**/*.egg-info/**": true,
    "**/.eggs/**": true,
    "**/htmlcov/**": true,
    "**/.coverage/**": true,
    "**/playwright-report/**": true,
    "**/.playwright/**": true,
    "**/screenshot.png": true,
    "**/*.prof": true,
    "**/.cursor/**": true,
    "**/.kiro/**": true,
    "**/.idea/**": true,
    "**/.vercel/**": true,
    "**/.qoder/**": true,
    "**/.continue/**": true,
    "**/*.sqlite3": true,
    "**/*.db": true,
    "**/*.log": true,
    "**/.env": true,
    "**/.env.*": true,
    "**/.DS_Store": true,
    "**/Thumbs.db": true
  },
  
  "search.exclude": {
    "**/venv/**": true,
    "**/.venv/**": true,
    "**/env/**": true,
    "**/node_modules/**": true,
    "**/.pnpm-store/**": true,
    "**/.git/**": true,
    "**/__pycache__/**": true,
    "**/*.py[cod]": true,
    "**/.mypy_cache/**": true,
    "**/.ruff_cache/**": true,
    "**/.pytest_cache/**": true,
    "**/dist/**": true,
    "**/dev-dist/**": true,
    "**/build/**": true,
    "**/*.egg-info/**": true,
    "**/.eggs/**": true,
    "**/htmlcov/**": true,
    "**/.coverage/**": true,
    "**/playwright-report/**": true,
    "**/.playwright/**": true,
    "**/screenshot.png": true,
    "**/*.prof": true,
    "**/.cursor/**": true,
    "**/.kiro/**": true,
    "**/.idea/**": true,
    "**/.vercel/**": true,
    "**/.qoder/**": true,
    "**/.continue/**": true,
    "**/*.sqlite3": true,
    "**/*.db": true,
    "**/*.log": true,
    "**/.env": true,
    "**/.env.*": true,
    "**/.DS_Store": true,
    "**/Thumbs.db": true,
    "**/yarn.lock": true,
    "**/package-lock.json": true,
    "**/pnpm-lock.yaml": false
  }
}