Skip to content

Add TextMate bundle for Vera syntax highlighting#364

Merged
aallan merged 5 commits into
mainfrom
feat/textmate-bundle
Mar 26, 2026
Merged

Add TextMate bundle for Vera syntax highlighting#364
aallan merged 5 commits into
mainfrom
feat/textmate-bundle

Conversation

@aallan

@aallan aallan commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • editors/textmate/Vera.tmbundle — full TextMate 2 grammar for .vera files
  • editors/textmate/README.md — installation instructions and scope reference
  • README.md — Editor Support section with install command
  • docs/index.html — TextMate icon + download link with trademark attribution

What gets highlighted

Slot references, contract blocks, effects, ADT constructors, qualified calls, string interpolation, operators, comments. The .tmLanguage format is also compatible with Sublime Text.

Test plan

  • All 21 pre-commit hooks pass
  • README examples parse correctly
  • CI passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a TextMate syntax highlighting bundle for Vera (file-type registration, scope name and comprehensive token highlighting), compatible with TextMate-consuming editors.
  • Documentation

    • Added an “Editor support” section to the README with installation instructions.
    • Added a dedicated bundle README documenting token-to-scope mappings, coverage and a known limitation.
  • Chores

    • Added bundle metadata and grammar files; updated example count and adjusted README example references, test and script line numbers.

TextMate 2 grammar covering the full Vera language: slot references,
contracts, effects, ADT constructors, string interpolation, and all
operators. Compatible with Sublime Text and other tmLanguage consumers.

- editors/textmate/Vera.tmbundle — the bundle directory
- editors/textmate/README.md — installation and scope reference
- README.md: Editor Support section with install instructions
- docs/index.html: TextMate icon + download link with attribution

Co-Authored-By: Claude <noreply@anthropic.invalid>
@coderabbitai

coderabbitai Bot commented Mar 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a TextMate syntax bundle and docs for the Vera language, updates the root README to list editor support and example count, and adjusts a README code-fence allowlist entry line number in test and script files.

Changes

Cohort / File(s) Summary
Root docs
README.md
Added "Editor support" section referencing a TextMate bundle, updated example count from 27→29 and project tree to include editors/textmate/.
TextMate bundle docs
editors/textmate/README.md
New README describing installation, token scopes, scope naming, regex limitations, compatibility and MIT license.
TextMate bundle metadata
editors/textmate/Vera.tmbundle/info.plist
New bundle plist with name, uuid, description and contact metadata.
TextMate grammar
editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage
New comprehensive TextMate grammar (source.vera) covering nestable block and line comments, interpolated strings, slot references, numeric literals, multiple keyword classes, ADT/effect/type identifiers, qualified calls, constructor/function heuristics, operators and punctuation.
Readme allowlist updates
scripts/check_readme_examples.py, tests/test_readme.py
Adjusted allowlist entry for the "Project Roadmap" fenced Vera block opening line from 717729 to keep script and tests aligned.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested labels

docs, ci, tests

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the primary change: adding a complete TextMate syntax highlighting bundle for Vera, which constitutes the bulk of the changeset across multiple new files and grammar definitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/textmate-bundle

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Mar 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.32%. Comparing base (d6134ff) to head (94bbced).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #364   +/-   ##
=======================================
  Coverage   90.32%   90.32%           
=======================================
  Files          49       49           
  Lines       18999    18999           
  Branches      219      219           
=======================================
  Hits        17161    17161           
  Misses       1834     1834           
  Partials        4        4           
Flag Coverage Δ
javascript 50.73% <ø> (ø)
python 95.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage`:
- Around line 93-106: The current TextMate grammar rules
variable.other.slot.vera and variable.other.slot-binding.vera use the match
patterns "@[A-Z][A-Za-z0-9_]*(?:&lt;[^&gt;]*&gt;)*\.(?:result|\d+)" and
"@[A-Z][A-Za-z0-9_]*(?:&lt;[^&gt;]*&gt;)*(?=\s*[,)\]}])" which cannot handle
nested generics (e.g., `@Array`<Option<Int>>.0) because the
"(?:&lt;[^&gt;]*&gt;)*" stops at the first '>'; add a short note to
editors/textmate/README.md documenting this known regex limitation and listing
the affected patterns and scopes (variable.other.slot.vera and
variable.other.slot-binding.vera), and state that nested generics are an
accepted edge case rather than attempting an impractically complex regex.
- Around line 191-197: Update the built-in ADT types regex in the dict whose
name is "storage.type.adt.vera" (the match currently is
"\b(MdBlock|MdInline|UrlParts)\b") to include HtmlNode by adding it to the
alternation (e.g. "\b(MdBlock|MdInline|UrlParts|HtmlNode)\b"), preserving the
word boundaries and existing pattern formatting so references to HtmlNode are
scoped as storage.type.adt.vera.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 21b73090-8ed4-4af5-abca-6c0ed4004f0b

📥 Commits

Reviewing files that changed from the base of the PR and between d6134ff and 01640a6.

⛔ Files ignored due to path filters (2)
  • docs/index.html is excluded by !docs/**
  • docs/textmate-icon.png is excluded by !**/*.png, !docs/**
📒 Files selected for processing (6)
  • README.md
  • editors/textmate/README.md
  • editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage
  • editors/textmate/Vera.tmbundle/info.plist
  • scripts/check_readme_examples.py
  • tests/test_readme.py

Comment thread editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage
Comment thread editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage
aallan and others added 3 commits March 26, 2026 15:05
Tighten icon-text gap, left-align trademark line under download text,
link MacroMates name to macromates.com. Remove duplicate Editor Support
section from Get Started (hero placement is sufficient). Add MacroMates
credit to README.

Co-Authored-By: Claude <noreply@anthropic.invalid>
Same format as hero: icon + download link + trademark line,
no heading, tight spacing under the CLI code block.

Co-Authored-By: Claude <noreply@anthropic.invalid>
Co-Authored-By: Claude <noreply@anthropic.invalid>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage`:
- Around line 251-257: The constructor match list for the ADT highlighting rule
(the dict with name "entity.name.tag.constructor.vera" and its match regex) is
missing the HtmlNode constructors; update the regex in the <key>match</key>
string to include HtmlElement, HtmlText, and HtmlComment (keeping the existing
\b word boundaries and the single alternation group) so those constructors are
highlighted alongside the other ADT constructors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 929717c2-3f82-4524-bc23-52a1be230fe8

📥 Commits

Reviewing files that changed from the base of the PR and between e47cb58 and 0e9728b.

⛔ Files ignored due to path filters (1)
  • docs/index.html is excluded by !docs/**
📒 Files selected for processing (2)
  • editors/textmate/README.md
  • editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage

Comment thread editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage
…ghting

Co-Authored-By: Claude <noreply@anthropic.invalid>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage`:
- Around line 142-148: The pattern keyword.other.forall.vera currently uses
\b(forall)\b which shadows the more specific quantifier pattern
\b(forall|exists)\b(?=\s*\() and leaves standalone exists unhighlighted; fix by
either adding exists to the general keyword pattern (change \b(forall)\b to
\b(forall|exists)\b in the dict with name "keyword.other.forall.vera") OR remove
forall from that general pattern so the quantifier-specific rule (the dict using
\b(forall|exists)\b(?=\s*\()) can exclusively handle both tokens including
standalone exists; update only the regex in the referenced dict accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1fd4d2f1-89a5-4d1d-9e8d-ae65a9442c8b

📥 Commits

Reviewing files that changed from the base of the PR and between 0e9728b and 94bbced.

📒 Files selected for processing (1)
  • editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage

Comment on lines +142 to +148
<!-- Generic / polymorphism keyword -->
<dict>
<key>name</key>
<string>keyword.other.forall.vera</string>
<key>match</key>
<string>\b(forall)\b</string>
</dict>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

forall is defined twice; exists won't highlight standalone.

forall appears in two patterns:

  • Line 147: \b(forall)\b — matches anywhere
  • Line 410: \b(forall|exists)\b(?=\s*\() — matches only when followed by (

Since TextMate uses first-match semantics, line 147 always wins for forall, making the quantifier-specific scope at line 410 unreachable for forall. Meanwhile, exists is only in the quantifier pattern, so exists without a following ( receives no highlighting at all.

Consider either:

  1. Adding exists to the general keyword list at line 147, or
  2. Removing forall from line 147 if the intent is quantifier-specific scoping.
Option 1: Add exists to general keywords
 		<!-- Generic / polymorphism keyword -->
 		<dict>
 			<key>name</key>
 			<string>keyword.other.forall.vera</string>
 			<key>match</key>
-			<string>\b(forall)\b</string>
+			<string>\b(forall|exists)\b</string>
 		</dict>

Also applies to: 405-411

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@editors/textmate/Vera.tmbundle/Syntaxes/Vera.tmLanguage` around lines 142 -
148, The pattern keyword.other.forall.vera currently uses \b(forall)\b which
shadows the more specific quantifier pattern \b(forall|exists)\b(?=\s*\() and
leaves standalone exists unhighlighted; fix by either adding exists to the
general keyword pattern (change \b(forall)\b to \b(forall|exists)\b in the dict
with name "keyword.other.forall.vera") OR remove forall from that general
pattern so the quantifier-specific rule (the dict using
\b(forall|exists)\b(?=\s*\()) can exclusively handle both tokens including
standalone exists; update only the regex in the referenced dict accordingly.

@aallan aallan merged commit 25965f1 into main Mar 26, 2026
17 checks passed
@aallan aallan deleted the feat/textmate-bundle branch March 26, 2026 15:31
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