当前位置: 首页 > Skill >

VSCode

VSCode

VSCode

避免常见的 VSCode 错误——设置冲突、调试器配置和扩展冲突。

1.0.0 2026.11.18 798
获取Skill文件查看使用说明
类 别:PHP 开发工具选型与配置、PHP 本地断点调试配置与排查、VS Code 配置 PHP 开发环境教程 作 者:江言 许可证: 更新时间:2026.11.18
本文目录收起

Settings Precedence

  • User → Workspace → Folder — later overrides earlier
  • .vscode/settings.json per project — overrides user settings
  • "editor.formatOnSave" in workspace overrides user — can be confusing
  • Multi-root workspaces need per-folder settings — or root .code-workspace file
  • Some settings only work in user — "terminal.integrated.shell" is user-only

Formatter Conflicts

  • Multiple formatters for same language — set "[language]": {"editor.defaultFormatter": "id"}
  • Prettier vs ESLint both formatting — disable one: "prettier.enable": false in ESLint projects
  • Format on save runs wrong formatter — explicit defaultFormatter required
  • .editorconfig overrides some settings — can conflict with extension settings

Debugger Setup

  • launch.json needed for most debugging — can't just press F5
  • "cwd" relative to workspace root — not launch.json location
  • "program" path wrong — use ${workspaceFolder}/path/to/file
  • Node.js: "skipFiles" to avoid stepping into node_modules
  • Compound configurations for multi-process — "compounds" array in launch.json

Extensions

  • Extension host crash — disable recently installed, enable one by one
  • "Cannot find module" after install — restart VS Code completely
  • Extension settings not applying — check if workspace setting overrides
  • Conflicting extensions — keybinding conflicts, duplicate features

Terminal

  • Wrong shell on new terminal — set "terminal.integrated.defaultProfile.*"
  • Environment variables missing — terminal inherits from launch method, not .bashrc
  • Path not updated after install — restart VS Code, not just terminal
  • Shell integration issues — "terminal.integrated.shellIntegration.enabled": false to disable

Remote Development

  • SSH: ~/.ssh/config Host must match — "remote.SSH.configFile" to use different config
  • Containers: .devcontainer/devcontainer.json required — won't auto-detect Dockerfile
  • WSL: extensions install separately — WSL extensions stay in WSL
  • Port forwarding: auto but not always — check Ports panel

Workspace Trust

  • Restricted mode disables some features — debugging, tasks, some extensions
  • Trust prompt on first open — "Trust Folder" to enable everything
  • Per-folder trust in multi-root — can trust some folders, not others

Common Fixes

  • IntelliSense not working — check language server status in Output panel
  • "Cannot find module" in TypeScript — restart TS server: Cmd+Shift+P → "TypeScript: Restart TS Server"
  • Git not detecting changes — check if inside subfolder, .git must be at root or configured
  • Settings not saving — check write permissions on settings.json

相关文章

更多
VS Code配置Xdebug进行PHP断点调试教程

在 VS Code 中配置 Xdebug 进行 PHP 断点调试,核心步骤是安装扩展、配置 php.ini 启用 Xdebug 并设置监听端口、在 VS Code 中创建 launch.json 映射本地路径与容器或 CLI 环境路径,并确保 PHP 版本与 Xdebug 版本兼容。

2026.10.31 747
VS Code PHP开发优化:配置Intelephense智能提示与代码格式化

在 VS Code 中配置 PHP 开发环境,核心是安装 Intelephense 扩展并启用 Prettier 进行代码格式化。只需在扩展商店搜索安装这两个插件,并在用户设置中关联它们即可实现智能提示与自动格式化。

2026.03.07 423
VS Code 配置 PHP 运行环境:从安装到执行第一个脚本

在 VS Code 中运行 PHP 脚本,核心是安装官方 PHP Intelephense 扩展并配置系统环境变量。确保终端能直接调用 php 命令后,使用快捷键 F5 或右键菜单中的 Run PHP File 即可执行当前文件。

2026.05.05 416
怎么在PhpStorm中管理并切换多个PHP版本

在 PhpStorm 中切换 PHP 版本,核心操作是进入 Settings/Preferences 的 PHP 配置页,通过下拉菜单选择已注册的 CLI Interpreter 。若列表为空或版本不对,需点击齿轮图标添加本地路径或远程解释器。

2026.05.06 523
PhpStorm配置本地PHP解释器:Windows与macOS路径设置指南

在 Settings/Preferences 的 PHP 设置中,将 CLI Interpreter 指向本地 PHP 可执行文件路径即可。

2025.05.26 381
怎么在PhpStorm中配置Docker或WSL远程PHP解释器

在 PhpStorm 中配置 Docker 或 WSL 远程 PHP 解释器,核心是先在系统终端确认路径可用,再在 IDE 的 Settings 中通过 SSH 或本地映射添加解释器,并同步项目文件路径。

2025.02.23 119
Skill 文件

相关 Skill

更多
php-pro php-pro 面向现代 PHP 项目整理类型、设计模式、异步边界、自动加载和性能检查。 来源技能面向 PHP 8.3+;先核对框架、扩展和项目依赖。
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...