Files
slhx agent 797132647f feat(diagnostics): add compiler-backed heml language service
Add hemx-lsp for stdio LSP diagnostics, completion, and hover while preserving HTML editor tooling for .heml files. Teach hemx-build to expose generated target and derive-known template context facts, including simple h-for locals, so editor help comes from build-owned facts instead of editor-only parsers. Wire VS Code/Cursor and Neovim documentation and extend the Workout exemplar with a real h-for plan loop for end-to-end proof.

req: diag/004

req: diag/005

req: diag/006
2026-06-22 22:06:42 +02:00

40 lines
1.1 KiB
Markdown

# Hemx HEML for VS Code and Cursor
This extension keeps `.heml` files in VS Code's HTML language mode and layers the
shared `hemx-lsp` service on top for diagnostics, completion, and hover. It does
not define a separate grammar, formatter, selector model, or editor-only parser.
req: diagnostics/004 req: diagnostics/005
## Run from a hemx checkout
Open the repository in VS Code/Cursor and use this extension from source. The
extension detects `hemx-lsp/Cargo.toml` at the workspace root and starts:
```sh
cargo run -p hemx-lsp -- lsp
```
## Run with an installed binary
Install the shared service and open any app workspace:
```sh
cargo install --path hemx-lsp
```
The extension then starts:
```sh
hemx-lsp lsp
```
If your binary lives elsewhere, set `hemx.heml.lspCommand` and
`hemx.heml.lspArgs` in VS Code/Cursor settings.
## Behavior
- `.heml` defaults to VS Code's `html` language mode.
- Diagnostics are displayed from `hemx-build` via `hemx-lsp`.
- Completion and hover come from `hemx-lsp` and `docs/hemplate-syntax.md`.
- If the language service cannot start, normal HTML highlighting still works.