docs(editor): define hemplate highlight boundary
Document the repo-owned .heml highlighting overlay tokens and exclude diagnostics/completion/formatting/build validation from highlighting authority. req: diagnostics/004 req: diagnostics/008
This commit is contained in:
@@ -67,6 +67,28 @@ The one-shot command prints a JSON object shaped like LSP
|
||||
The diagnostic payload comes from `hemx-build`; editor integrations should display
|
||||
it as-is instead of recreating the rule.
|
||||
|
||||
## Highlighting boundary
|
||||
|
||||
Repo-owned `.heml` highlighting is an HTML overlay, not a new language. Normal
|
||||
HTML highlighting owns tags, attributes, strings, comments, folding, and tag
|
||||
matching. The hemplate overlay may highlight only documented syntax tokens from
|
||||
`docs/hemplate-syntax.md`:
|
||||
|
||||
- escaped text delimiters and expression regions: `{+` and `+}`;
|
||||
- trusted/rendered HTML delimiters and expression regions: `{+=` and `=+}`;
|
||||
- dynamic attribute prefixes such as `+class`, `+disabled`, and `+aria-label`;
|
||||
- structural directives: `h-if`, `h-for`, `h-key`, `h-match`, and `h-case`;
|
||||
- hemx facts recorded as ordinary attributes: `data-hemx-root`,
|
||||
`data-hemx-slot`, `data-hemx-form`, `data-hemx-handle`, and other checked
|
||||
`data-hemx-*` authoring attributes.
|
||||
|
||||
Highlighting must not own diagnostics, completion, hover, formatting, Rust
|
||||
expression parsing, selector behavior, generated Rust facts, or build
|
||||
validation. Those remain with `hemx-build`, `hemx-lsp`, normal HTML tooling, and
|
||||
Rust tooling. Repo tests for highlighting should therefore be fixture/query tests
|
||||
for captures over these token classes; provider packaging or visual editor smoke
|
||||
is a separate release slice and cannot become syntax authority. req: diagnostics/004 req: diagnostics/008
|
||||
|
||||
## VS Code and Cursor
|
||||
|
||||
Use the shared repo extension in `editors/vscode-hemx` for VS Code and Cursor.
|
||||
|
||||
Reference in New Issue
Block a user