Skip to content

Add VS Code extension for Vera syntax highlighting#365

Merged
aallan merged 2 commits into
mainfrom
feat/vscode-extension
Mar 27, 2026
Merged

Add VS Code extension for Vera syntax highlighting#365
aallan merged 2 commits into
mainfrom
feat/vscode-extension

Conversation

@aallan

@aallan aallan commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds editors/vscode/ — a full VS Code language extension for .vera files (syntax highlighting + language configuration)
  • Grammar covers Vera v0.0.100 including HtmlNode/HtmlElement/HtmlText/HtmlComment (the original was written against v0.0.67 — these were missing)
  • Fixes placeholder GitHub URLs in package.json (vera-vscodevera)
  • Fixes installation instructions to clone the main vera repo and symlink from editors/vscode/
  • Adds editors/README.md listing both VS Code and TextMate packages (with Sublime Text compatibility note)
  • Updates docs/index.html: removes duplicate TextMate shoutout from hero section; adds VS Code shoutout alongside TextMate in Get Started
  • Updates README.md editor support section to include VS Code alongside TextMate
  • VS Code icon (docs/vscode-icon.png) sourced from Wikimedia Commons, CC BY-SA 4.0

Test plan

  • All pre-commit hooks pass (mypy, pytest, conformance suite, examples, doc counts, site assets)
  • Grammar verified against current TextMate grammar — identical scope names, patterns updated to v0.0.100
  • Manually install extension via symlink and open a .vera file in VS Code to confirm highlighting

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Initial release of a Vera VS Code extension providing full syntax highlighting and editor behaviours (bracket matching, auto-closing, folding, indentation, comment toggling, slot-aware selection).
  • Documentation

    • Added an "Editor support" guide with VS Code and TextMate installation options, including linking-from-source and extension package installation.
    • New extension README and changelog summarising supported language features.
  • Tests / Chores

    • Small README parsing test adjustments to reflect updated documentation line numbers.

- Add editors/vscode/ — VS Code language extension with syntax
  highlighting and language configuration for .vera files
- Grammar covers full Vera as of v0.0.100: slot references, contracts,
  effects (IO/State/Exn/Http/Async/Diverge), ADT constructors including
  HtmlNode/HtmlElement/HtmlText/HtmlComment, string interpolation,
  nestable block comments, all operators
- Fix package.json URLs (repository/bugs → aallan/vera, not vera-vscode)
- Fix README.md: clone from main vera repo, symlink from editors/vscode/,
  TextMate bundle link to editors/textmate in this repo
- Add editors/README.md listing both VS Code and TextMate packages
- Add docs/vscode-icon.png (CC BY-SA 4.0, Wikimedia Commons)
- Update docs/index.html: remove duplicate TextMate shoutout from hero
  section; add VS Code shoutout alongside TextMate in Get Started section
- Update README.md editor support section to lead with VS Code
- Fix stale allowlist line number after README edit

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

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7e2c1295-3439-4f82-bd51-6e9a784d1765

📥 Commits

Reviewing files that changed from the base of the PR and between c97ab08 and 4191343.

📒 Files selected for processing (1)
  • editors/vscode/README.md

📝 Walkthrough

Walkthrough

A VS Code language extension and supporting TextMate grammar for Vera are added under editors/, editor documentation pages are introduced, the main README’s Editor support section is updated to promote the VS Code option (with symlink install instructions), and README-related allowlist line numbers in test/script files are adjusted.

Changes

Cohort / File(s) Summary
Top-level README / Editor docs
README.md, editors/README.md
Promotes VS Code extension install (including symlink example), reintroduces TextMate bundle as an alternative, updates project structure diagram and adds editors documentation.
VS Code extension manifest & config
editors/vscode/package.json, editors/vscode/language-configuration.json
New vera-language extension declared; registers vera language and .vera extension; language-configuration sets comments, bracket pairs, auto-closing, folding and indentation rules, and a wordPattern for identifiers and slot forms.
VS Code TextMate grammar
editors/vscode/syntaxes/vera.tmLanguage.json
New TextMate grammar implementing nested block comments, line comments, string escapes with interpolation, slot variables, numeric literals, keywords (declarations, contracts, control), types/effects, operators and punctuation for Vera.
VS Code extension docs & metadata
editors/vscode/README.md, editors/vscode/CHANGELOG.md, editors/vscode/LICENSE, editors/vscode/.gitignore, editors/vscode/.vscodeignore
Adds extension README, changelog (v0.1.0), MIT license, and ignore rules for packaging/build artifacts and VS Code packaging.
Test & script allowlist updates
scripts/check_readme_examples.py, tests/test_readme.py
Adjusted README code-fence allowlist key from line 729 to 736 to match reflowed README content.

Sequence Diagram(s)

(omitted — changes are documentation and editor integration files; no new runtime control flow across multiple runtime components to visualise)

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested Labels

tests, ci, docs

🚥 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 directly and accurately describes the main changeset: addition of a complete VS Code extension with syntax highlighting for Vera language files.
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/vscode-extension

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

@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: 3

🤖 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/vscode/README.md`:
- Around line 28-33: The README currently documents a symlink using the path
"$(pwd)/vera/editors/vscode" which only works when run from the parent of the
repo; update the docs to show two correct workflows: keep the existing
clone+symlink example for running from the parent, and add the alternative
symlink command using "$(pwd)/editors/vscode" for users who are already in the
repository root (reference the exact strings "$(pwd)/vera/editors/vscode" and
"$(pwd)/editors/vscode" in the README entry to make the distinction explicit).
- Line 68: The scope table documents the pipe operator incorrectly as `\|>`;
update the table row that uses the symbol `\|>` to instead use the actual
operator `|>` so the mapping to `keyword.operator.pipe.vera` is accurate (search
for the table entry containing `\|>` and replace it with `|>` in
editors/vscode/README.md).

In `@editors/vscode/syntaxes/vera.tmLanguage.json`:
- Around line 120-131: The current regex match
"\\b([A-Z][A-Za-z0-9_]*)(\\.)([a-z_][a-z_0-9]*)\\b" (which assigns the
"entity.name.function.effect-op.vera" capture) is too broad; narrow it so only
effect-qualified calls are matched. Replace this single generic rule with a
two-step approach: (1) add a rule to explicitly capture effect
declarations/names (store them in a repository or tag them as
"entity.name.type.effect.vera"), and (2) change the effect-op matcher to only
match when the qualifier is one of those effect names (or, as a simple
narrowing, require the qualifier to follow an explicit effect naming convention
such as ending with "Effect" or be matched via a lookbehind/backreference),
keeping the same capture names ("1" = effect type, "2" =
punctuation.accessor.vera, "3" = entity.name.function.effect-op.vera). Ensure
you remove or replace the broad "\\b([A-Z]...)(\\.)([a-z_]...)" rule so regular
qualified names are no longer highlighted as effect operations.
🪄 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: e44a9772-ee16-4181-9ab1-4c994616f4b5

📥 Commits

Reviewing files that changed from the base of the PR and between 25965f1 and c97ab08.

⛔ Files ignored due to path filters (4)
  • docs/index.html is excluded by !docs/**
  • docs/sitemap.xml is excluded by !docs/**
  • docs/vscode-icon.png is excluded by !**/*.png, !docs/**
  • editors/vscode/images/vera-icon.png is excluded by !**/*.png
📒 Files selected for processing (12)
  • README.md
  • editors/README.md
  • editors/vscode/.gitignore
  • editors/vscode/.vscodeignore
  • editors/vscode/CHANGELOG.md
  • editors/vscode/LICENSE
  • editors/vscode/README.md
  • editors/vscode/language-configuration.json
  • editors/vscode/package.json
  • editors/vscode/syntaxes/vera.tmLanguage.json
  • scripts/check_readme_examples.py
  • tests/test_readme.py

Comment thread editors/vscode/README.md Outdated
Comment thread editors/vscode/README.md Outdated
Comment thread editors/vscode/syntaxes/vera.tmLanguage.json
@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.32%. Comparing base (25965f1) to head (4191343).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #365   +/-   ##
=======================================
  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.

- Split installation into fresh-clone vs existing-clone cases to
  clarify the correct $(pwd) base in each scenario
- Fix pipe operator in scope table: \|> -> |> (stray escape char)

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

aallan commented Mar 27, 2026

Copy link
Copy Markdown
Owner Author

Addressed the three CodeRabbit comments:

1. Symlink path ambiguity (#3001223057) — Fixed. Split installation into two explicit cases (fresh clone vs. existing clone from repo root) so the $(pwd) base is unambiguous.

2. Pipe operator escape (#3001223076) — Fixed. \|>|> in the scope table.

3. Effect matcher too broad (#3001223082) — Keeping as-is. In Vera, the . operator between an uppercase name and a lowercase name is exclusively used for effect operations — modules use :: (vera.math::abs), not .. The broad [A-Z][A-Za-z0-9_]* match is correct because it also covers user-defined effects: effect Foo { op bar(...) }Foo.bar(...). Restricting to a hardcoded list would silently break highlighting of every user-defined effect.

@aallan aallan merged commit 9f517cb into main Mar 27, 2026
17 checks passed
@aallan aallan deleted the feat/vscode-extension branch March 27, 2026 14:22
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