0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/crates/syntax
zeronsh[bot] 187b402439
Syntax: Luau highlighting (#1031)
`.luau` files and ```luau fences now highlight with the official
tree-sitter-luau grammar (tree-sitter-grammars, pinned at 1.2.0), and
Luau files get their icon wherever a language resolves one.

The upstream query targets Neovim, and several patterns misfire under
tree-sitter-highlight; each is rewritten against its exact upstream text, so
a grammar bump that changes one fails the tests instead of drifting:
- `#lua-match?` isn't evaluated by the Rust runtime (every identifier
  matched the type and constant patterns): rewritten to `#match?`.
- `(comment) @comment @spell`: the unmapped second capture took the
  comment's highlight.
- `(type (identifier))`: `type` is a supertype that includes `identifier`,
  so it matched every name. Types are matched where they sit instead —
  after an annotation's `:`, a cast's `::`, an alias's `=`, or inside a
  composite type.
- Table-type keys and function-type parameters are only the names before
  a `:` (the grammar doesn't parse named function-type parameters at all).

Co-authored-by: Wing <44917547+wingleeio@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
History 2026-10-25 06:46:09 +00:00
..
queries/kotlin fix(syntax): cover Kotlin query edge cases 2026-08-28 17:25:25 -04:00
src Syntax: Luau highlighting (#1031) 2026-10-25 06:46:09 +00:00
tests fix(syntax): cover Kotlin query edge cases 2026-08-28 17:25:25 -04:00
Cargo.toml Syntax: Luau highlighting (#1031) 2026-10-25 06:46:09 +00:00