Skip to content

fix: update the TextMate grammar and colour pub with the other keywords - #216

Merged
magnus-madsen merged 1 commit into
masterfrom
update-textmate-grammar
Aug 9, 2026
Merged

fix: update the TextMate grammar and colour pub with the other keywords#216
magnus-madsen merged 1 commit into
masterfrom
update-textmate-grammar

Conversation

@magnus-madsen

Copy link
Copy Markdown
Member

Bumps the pinned flix/textmate commit from befa883 to 1da5462, and fixes a theme override that kept pub blue.

Grammar

Upstream changes picked up by the bump:

  • function names are highlighted: foo(...) gets entity.name.function, List.map gets support.function
  • the type rule widens from the 11 primitives to every capitalised identifier
  • pub moves from storage.type.modifier.flix to storage.modifier.flix
  • dbg, resume, typematch, law, without, opaque, handler, xvar, branch, jumpto, and lawful are dropped

Why pub stayed blue

The scope rename on its own changed nothing on the site. CodeSnippet.astro appends a rule for a bare storage to make every Flix keyword magenta, but TextMate resolves a token to the most specific matching selector rather than the last one written — and Light+ ships its own storage.modifier rule in blue. A bare storage loses to it, just as it previously lost to storage.type.

Naming storage.modifier explicitly ties on specificity, so the override wins on order.

pub def foo(): Int32 = 42 rendered through the site's theme:

pub def foo Int32
before #0000FF #AF00DB #267F99
after #AF00DB #AF00DB #795E26 #267F99

🤖 Generated with Claude Code

Bump the pinned flix/textmate commit from befa883 to 1da5462, which adds
function-name highlighting, widens the type rule beyond the primitives,
and renames the pub modifier's scope to storage.modifier.flix.

That rename alone left pub blue. The theme override here appends a rule
for a bare storage, but TextMate resolves a token to the most specific
matching selector rather than the last one written, and Light+ ships its
own storage.modifier rule in blue. Name storage.modifier explicitly so
the override ties on specificity and wins on order.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@magnus-madsen
magnus-madsen merged commit f7ad308 into master Aug 9, 2026
2 checks passed
@magnus-madsen
magnus-madsen deleted the update-textmate-grammar branch August 9, 2026 10:11
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