From 515c76f5abd9b1afa88e2ef038137f717a4883dd Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Thu, 23 Jul 2026 16:11:47 -0400 Subject: [PATCH] docs+test(web): name and pin the @attribute retro-paint (review round 3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review found that adding ("attribute", fg(3)) for HTML/CSS also colours the @attribute capture three already-bundled grammars emit — rust (attribute_item), lua (), yaml (directives) — which were previously unpainted. Verified on a Rust buffer: #[derive(Debug)] now paints uniformly yellow (fg 3), an improvement over unpainted and the distinct-attribute convention most editors follow. Name this retro-paint as intended in the framing (Q#WEB4, rev 4) and pin it with rust_attribute_repaints_via_shared_attribute_capture so it is a chosen effect, not incidental. @tag is unaffected (HTML/CSS only). Co-Authored-By: Claude Fable 5 --- docs/web-grammars-html-css-framing.md | 36 +++++++++++++++--- src/highlight.rs | 55 +++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 6 deletions(-) diff --git a/docs/web-grammars-html-css-framing.md b/docs/web-grammars-html-css-framing.md index 8378e56..732f99b 100644 --- a/docs/web-grammars-html-css-framing.md +++ b/docs/web-grammars-html-css-framing.md @@ -1,11 +1,11 @@ # Web grammars (HTML + CSS) + HTML injections — framing -**Revision 3 — pre-implementation. Ground truth: canonical `main` @ -`4daa1b8` (after LaTeX #144 and inline-math-docs #145), 2026-07-23. Status: -framing only; no implementation.** Rev 2 settled the capture set, injection -scope, and LSP claim (round 1); rev 3 corrects the `#match?` predicate analysis -(tree-sitter evaluates it natively) and refreshes the folding footprint to the -current branch (round 2). See §0.1. +**Revision 4 — implemented on branch `web-grammars` (PR #146). Ground truth: +canonical `main` @ `4daa1b8` (after LaTeX #144 and inline-math-docs #145), +2026-07-23.** Rev 2 settled the capture set, injection scope, and LSP claim +(round 1); rev 3 corrected the `#match?` predicate analysis (round 2); rev 4 +names the intended `@attribute` retro-paint on the already-bundled rust/lua/yaml +grammars — verified on a Rust buffer and pinned by a test (round 3). See §0.1. ## 0.1 Revision history @@ -44,6 +44,17 @@ current branch (round 2). See §0.1. `overlay.rs`/`daemon.rs`/`syntax.rs`. §0 now lists the real set; the zero-overlap conclusion is unchanged (stronger, if anything). +### Round 3 (rev 3 → rev 4) + +- **R3-1 (medium).** Q#WEB4 verified which captures pmacs *lacks* but not the + reverse: which already-bundled grammars *use* `@attribute`. Three do — rust + (`attribute_item`), lua (``), yaml (directives) — so the new + `("attribute", fg(3))` entry retro-paints their previously-unpainted spans + yellow. Named in Q#WEB4 as intended (verified on a Rust buffer: uniform + yellow, an improvement over unpainted), and pinned by + `rust_attribute_repaints_via_shared_attribute_capture`. `tag` is unaffected + (HTML/CSS only). + Add tree-sitter **HTML** and **CSS** grammars so `.html`/`.htm` and `.css` buffers get lexical highlighting, and — the north-star payoff — light up HTML's embedded-language **injections**: `