test(lsp): add hemplate highlighting fixture

Add repo-owned hemplate highlighting fixture and golden capture contract without editor packaging or a second parser.

req: diagnostics/004

req: diagnostics/008
This commit is contained in:
slhx agent
2026-06-26 00:20:11 +02:00
parent 34327d6b8f
commit 2e55406a24
5 changed files with 80 additions and 5 deletions
+3 -1
View File
@@ -87,7 +87,9 @@ 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
is a separate release slice and cannot become syntax authority. The current
repo-owned fixture and golden capture contract live in
`docs/fixtures/hemplate-highlighting/`. req: diagnostics/004 req: diagnostics/008
## VS Code and Cursor
@@ -0,0 +1,17 @@
capture literal
@attribute.hemx data-hemx-root
@attribute.hemx data-hemx-form
@attribute.hemx data-hemx-handle
@attribute.hemx data-hemx-slot
@attribute.dynamic.hemplate +class
@keyword.control.hemplate h-if
@keyword.control.hemplate h-for
@keyword.control.hemplate h-key
@keyword.control.hemplate h-match
@keyword.control.hemplate h-case
@punctuation.special.hemplate.escaped.open {+
@punctuation.special.hemplate.escaped.close +}
@punctuation.special.hemplate.trusted.open {+=
@punctuation.special.hemplate.trusted.close =+}
@embedded.rust.hemplate result.title
@embedded.rust.hemplate result.summary_html
1 capture literal
2 @attribute.hemx data-hemx-root
3 @attribute.hemx data-hemx-form
4 @attribute.hemx data-hemx-handle
5 @attribute.hemx data-hemx-slot
6 @attribute.dynamic.hemplate +class
7 @keyword.control.hemplate h-if
8 @keyword.control.hemplate h-for
9 @keyword.control.hemplate h-key
10 @keyword.control.hemplate h-match
11 @keyword.control.hemplate h-case
12 @punctuation.special.hemplate.escaped.open {+
13 @punctuation.special.hemplate.escaped.close +}
14 @punctuation.special.hemplate.trusted.open {+=
15 @punctuation.special.hemplate.trusted.close =+}
16 @embedded.rust.hemplate result.title
17 @embedded.rust.hemplate result.summary_html
@@ -0,0 +1,18 @@
<main data-hemx-root="demo">
<form data-hemx-form="search" data-hemx-handle="run_search">
<input +class="self.search_class" name="query" />
</form>
<section h-if="self.show_results">
<template h-for="result in &self.results" h-key="result.id">
<article data-hemx-slot="result_row">
<h2>{+ result.title +}</h2>
<div>{+= result.summary_html =+}</div>
</article>
</template>
</section>
<template h-match="self.state">
<p h-case="ViewState::Empty">No results</p>
</template>
</main>