Skip to content

feat: highlight injected languages in the diff view - #62

Merged
undont merged 2 commits into
mainfrom
feat/syntax-injections
Oct 9, 2026
Merged

undont merged 2 commits into
mainfrom
feat/syntax-injections

Conversation

@undont

@undont undont commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • the diff view's syntax pass walks the whole treesitter language tree instead of the root alone, so any parser's injections highlight in their own language
  • each injection layer sits one priority above its host, so embedded code wins where both cover a region
  • captures are cached per model, so a layout or context toggle reprojects rather than reparsing both sides

Test plan

  • make lua-typecheck, luacheck, make go-vet, make demo-build
  • make test: unit 499/0, nvim 760/0, go ok
  • golangci-lint (left to CI; the local build can't load go 1.27's stdlib)

undont added 2 commits October 9, 2026 19:52
the syntax pass parsed only a file's own grammar, so anything a query hands
to another parser stayed plain: an astro file showed its tags and nothing
else, its frontmatter, script and style bodies all being injections.

walk the language tree instead of the root alone, host before its
injections, each layer one priority above the tree it was lifted from so
embedded code wins where the host also covers the region. captures are
cached per model, so a layout or context toggle reprojects rather than
reparsing both sides.
@undont
undont merged commit 310743a into main Oct 9, 2026
11 checks passed
@undont
undont deleted the feat/syntax-injections branch October 9, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant