Skip to main content

Zed

Zed is the hot new editor, in the style of VS Code, but from scratch. Here are some setup recommendations based on my experience.

PHP

Extensions

If using PHP, install the PHP extension.

Language Server

Zed uses the Phpactor language server by default. While I love its Open Source nature, it does not yet have the level of performance necessary for most projects. Mago is another promising new LSP to watch out for, but for now we have to stick with intelephense to get work done.

  1. Open Settings > Edit in settings.json
  2. Add this language_servers line under the PHP languages section, or att the entire section if it's not there yet.
{
  "languages": {
    "PHP": {
      "language_servers": ["intelephense", "!phpactor", "..."],
      "hard_tabs": true,
    },
  }
}

OPTIONAL: To save memory you can also add "!phptools" to that list so the Devsense LS isn't loaded either. Or can use it instead of intelephense.

Restart Zed and it should automatically download and switch to intelephense.

Built-in Webserver

To enable easy running of the PHP Built-in webserver:

  1. Run > Edit Tasks.json
  2. Add this inner record. Replace /src/web with the path to your index or router directory, or remove if not necessary. The $ZED_WORKTREE_ROOT ensures this always starts from your project root dir.
[
  {
    "label": "PHP: Bult-in Webserver",
    "command": "php -S 127.0.0.1:8000 -t $ZED_WORKTREE_ROOT/src/web",
    "use_new_terminal": false,
    "allow_concurrent_runs": false,
    "reveal": "always"
  }
]