Editor Tooling

Hyperphp editor tooling is split into two layers:

  • Tree-sitter grammar: tools/tree-sitter-hyperphp
  • Pure PHP language server: tools/hyperphp-lsp

Additional extension scaffolds:

  • VS Code extension: tools/extensions/vscode-hyperphp
  • Zed extension: tools/extensions/zed-hyperphp

Language Identity

  • language id: hyperphp
  • file extension: .hscpt

Tree-sitter

cd tools/tree-sitter-hyperphp
tree-sitter generate
tree-sitter test

LSP

Run manually over stdio:

php tools/hyperphp-lsp/bin/hyperphp-lsp

Supported methods in MVP:

  • initialize
  • shutdown
  • exit
  • textDocument/didOpen
  • textDocument/didChange
  • textDocument/didSave
  • textDocument/documentSymbol
  • textDocument/completion (keywords, builtins, basic in-scope params/vars)

The server publishes parser/lexer diagnostics using Hyperphp error codes (HSxxxx).

Tell Model IntelliSense Dictionary

For application/model-aware completion, add:

  • .hyperphp/models.json

This repository already includes a starter dictionary at that path.

Supported structure:

{
  "applications": {
    "mail": {
      "commands": ["sync"],
      "properties": ["mailbox"],
      "kinds": {
        "message": {
          "commands": ["mark_read"],
          "properties": ["subject", "read status"]
        }
      }
    }
  }
}

Completion behavior: - tell application " suggests application names from dictionary. - inside tell application "app" suggests app commands/properties/kinds. - inside nested tell <model> suggests that kind's commands/properties when inferable.

VS Code

  1. Open tools/extensions/vscode-hyperphp as an extension project.
  2. Run npm install.
  3. Launch extension host (F5).
  4. Open a .hscpt file in a workspace where tools/hyperphp-lsp/bin/hyperphp-lsp exists.

Or from terminal:

cd tools/extensions/vscode-hyperphp
npm install
npm run dev:host

Smoke test:

cd tools/extensions/vscode-hyperphp
npm install
npm run smoke

Settings:

  • hyperphp.phpPath
  • hyperphp.lspScriptPath

Zed

The scaffold includes language and LSP wiring in tools/extensions/zed-hyperphp. You can point Zed's extension dev workflow at this folder and use the included extension.toml and language config as the base package.

Current status: - Highlighting: implemented. - LSP diagnostics in Zed: not yet implemented in this scaffold.

Reason: - Zed language server command wiring is implemented via extension Rust/WASM APIs. - The current extension is declarative-only (no Rust/WASM bridge yet).