{ // 后端 Python 虚拟环境 "python.defaultInterpreterPath": "${workspaceFolder}/backend/.venv/Scripts/python.exe", "python.terminal.activateEnvironment": true, "python.venvPath": "${workspaceFolder}/backend", "python.venvFolders": [".venv"], // 默认终端:加载 cd 钩子,进入 backend 时自动激活 .venv "terminal.integrated.defaultProfile.windows": "PowerShell (HXOPS)", "terminal.integrated.profiles.windows": { "PowerShell (HXOPS)": { "source": "PowerShell", "icon": "terminal-powershell", "args": [ "-NoExit", "-ExecutionPolicy", "Bypass", "-File", "${workspaceFolder}/scripts/powershell-backend-auto-venv.ps1" ] }, "HXOPS Backend": { "source": "PowerShell", "icon": "server-environment", "args": [ "-NoExit", "-ExecutionPolicy", "Bypass", "-Command", "Set-Location '${workspaceFolder}/backend'; if (Test-Path '.venv/Scripts/Activate.ps1') { . '.venv/Scripts/Activate.ps1' }" ] } } }