{
  "markdown": "# Metal LSP\n\nFull language server features for Metal Shading Language in VSCode, Cursor, and Claude Code.\n\nAutocomplete, inline diagnostics, hover documentation, and go-to-definition for `.metal` files. Powered by clangd with Metal-aware headers.\n\n## Features\n\n| Feature | macOS | Linux/Windows |\n|---------|-------|---------------|\n| Autocomplete (stdlib + user code) | Full (real SDK headers) | Full (stubs) |\n| Inline diagnostics | Full | Best-effort (C++ mode) |\n| Hover documentation | From MSL spec | From MSL spec |\n| Go-to-definition | Yes | Yes (into stubs) |\n| Syntax highlighting | TextMate + semantic | TextMate + semantic |\n| Compile-on-save diagnostics | Yes (opt-in, via `xcrun metal`) | No |\n\n## Requirements\n\n- **clangd** — install via the [clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd), Homebrew (`brew install llvm`), or your system package manager\n- **macOS** (optional): Xcode or Command Line Tools for real Metal SDK headers. Without them, the extension falls back to bundled stubs.\n\n## Installation\n\n### VS Code / Cursor\n\nInstall from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=rayanhtt.metal-lsp). The extension activates automatically when your workspace contains `.metal` files.\n\nAlso available on [Open VSX](https://open-vsx.org/) for VSCodium and other editors.\n\n### Claude Code\n\n```bash\n/plugin marketplace add rayanht/metal-lsp\n/plugin install metal-lsp@rayanht-metal-lsp\n```\n\nOr for local development: `claude --plugin-dir /path/to/metal-lsp`\n\nProvides clangd-powered diagnostics, hover docs, and go-to-definition for `.metal` files directly in Claude Code CLI sessions. Requires `clangd` in PATH.\n\n## How It Works\n\nThe extension configures clangd to understand Metal by:\n\n1. Registering `.metal` files as the \"Metal\" language\n2. Running its own clangd language client scoped to Metal files\n3. Generating a `.clangd` config that tells clangd to parse `.metal` as C++ with Metal-compatible flags\n4. Providing a compat header that maps Metal keywords (`device`, `constant`, `kernel`, etc.) to C++ type qualifiers\n5. Bundling stub headers so `#include <metal_stdlib>` resolves — on macOS with Xcode, real SDK headers are used instead\n\n## Settings\n\n| Setting | Default | Description |\n|---------|---------|-------------|\n| `metal-lsp.metalStdVersion` | `\"metal3.0\"` | Metal Shading Language standard version (`metal1.0` through `metal4.0`) for compile-on-save |\n| `metal-lsp.compileDiagnostics` | `\"off\"` | `\"off\"` or `\"onSave\"` — run `xcrun metal` for real compiler diagnostics (macOS only) |\n| `metal-lsp.includePaths` | `[]` | Additional include directories for Metal shader compilation (added as `-isystem` paths) |\n| `metal-lsp.compileFlags` | `[]` | Additional compile flags passed to both clangd and the Metal compiler |\n\nThe workspace root is automatically added as an include path, so `#include \"shared/types.h\"` works out of the box if `shared/` is at your project root. The `includePaths` setting is only needed for directories outside your workspace.\n\n## Commands\n\n- **Metal LSP: Configure** — regenerate `.clangd` configuration\n- **Metal LSP: Show Status** — show diagnostic info (header source, SDK path, configured folders)\n- **Metal LSP: Restart Language Server** — restart the clangd language client\n- **Metal LSP: Open Documentation** — open Apple's MSL spec\n\n## License\n\nMIT\n",
  "bytes": 3419,
  "sha": "a3760e24dc26192ce14baf0199cf935d83c5c2d419167b22800339390dc501b1",
  "repo_slug": "rayanht/metal-lsp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_rayanht_metal_lsp_metal_lsp_59ae7c33/readme"
}