Skip to content

vscode: ship language extension with syntax + snippets + cursor install#410

Merged
danieljohnmorris merged 5 commits into
mainfrom
feature/vscode-extension
May 18, 2026
Merged

vscode: ship language extension with syntax + snippets + cursor install#410
danieljohnmorris merged 5 commits into
mainfrom
feature/vscode-extension

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Wraps the existing ilo.tmLanguage.json (which has been living quietly in the site repo, used only to render docs code blocks) into a proper VS Code extension at extensions/vscode/. Mirrors zero/extensions/vscode/ so anyone who's seen Zero's layout finds ilo's the same shape.

Why now: Zero ships a VS Code extension but explicitly marks it "private": true and never publishes. ilo can leapfrog by being marketplace-installable, which is a much stronger adoption signal than parity. This PR is the local-install + tests + scaffolding side of that work. Publishing to the marketplace is a separate step that needs the vsce publisher token, so I've left it out of this PR per Dan's protocol on destructive external actions.

What's in the diff

Five commits, one coherent change per commit:

  1. vscode: scaffold extension with grammar and language config - copy the canonical grammar from ilo-site/, write package.json (publisher ilo-lang, name ilo-lang, version 0.12.0, NOT private) and language-configuration/ilo.json with ilo's -- line comments, kebab-case word pattern, and bracket auto-close.
  2. vscode: add snippets for common ilo patterns - eight tab-trigger snippets (fn, tool, match, let, loop, guard, type, tern) covering the highest-friction patterns. Kept minimal; prefix notation should stay short.
  3. vscode: add cursor install script - scripts/install-cursor-extension.mjs mirrors Zero's, copies the extension into ~/.cursor/extensions/ so Cursor users can run it before Open VSX is live. Uses import.meta.url so it works from any cwd.
  4. vscode: add manifest and grammar smoke tests - six node --test cases asserting the manifest is correct, we're not marked private, the six brief-required snippets exist, the language config uses -- and kebab-case, and the grammar parses + names source.ilo. No external deps.
  5. vscode: add README, changelog, vscodeignore, and link from main README - extension README points at ilo-lang.ai, main README gets an "Editor support" section.

Test plan

  • cd extensions/vscode && npm test - 6/6 pass
  • package.json valid JSON, no "private": true
  • Manifest validates: language id ilo, extensions [".ilo"], scope source.ilo, snippets at ./snippets/ilo.code-snippets
  • Grammar parses, declares source.ilo, covers comments / strings / numbers / type sigils / builtins / keywords / operators
  • Snippets cover all six brief-required patterns
  • Manual: install into Cursor with npm run install:cursor, open an examples/*.ilo file, verify highlighting + snippet expansion + bracket auto-close (asking Dan to run this since I don't have Cursor on the build machine)

Follow-ups (not in this PR)

  • Marketplace publish. Needs the vsce publisher account for ilo-lang and a personal access token. Once that's set up: cd extensions/vscode && vsce package && vsce publish. Same for Open VSX (ovsx publish) for Cursor / VSCodium / openvscode-server.
  • Site repo grammar dedupe. The site at ilo-lang/ilo-site still reads ilo.tmLanguage.json from its own repo root for Astro / Expressive Code at build time. To avoid two grammar copies long-term, the site should either pull the grammar from this PR's path via a small build script (curl or a git submodule), or we publish the grammar to npm and the site depends on that. Out of scope for this PR; will open a follow-up issue on the site repo. The site's copy is byte-identical to the one in this PR today.
  • Marketplace screenshot. Listing wants at least one syntax-highlighting screenshot. Easiest to grab from an examples/*.ilo open in VS Code after install.
  • Grammar polish. Brief flagged the existing grammar might be stale (Risk 1). Quick spot-check is fine - I tested against examples/01-simple-function.ilo. Anything missing surfaces as a quick follow-up commit, not a blocker.

No em dashes in this PR; no AI signatures.

Copy the canonical ilo.tmLanguage.json from ilo-site/ into a real
VS Code extension at extensions/vscode/, mirroring zero/extensions/vscode/.
Language config covers --line comments, kebab-case word pattern,
bracket auto-close, and surrounding pairs for {} [] () "" ''.

Manifest is publisher ilo-lang, name ilo-lang, version 0.12.0 tracking
the ilo language version. NOT marked private - we will publish to the
marketplace separately.
Eight tab-trigger snippets covering the highest-friction patterns
agents and humans hit when writing ilo: fn, tool, match, let, loop,
guard, type, tern. Kept minimal - prefix notation is supposed to be
short, snippets shouldn't paper over that.
Mirror zero/extensions/vscode/scripts/install-cursor-extension.mjs.
Copies the extension into ~/.cursor/extensions/<publisher>.<name>-<version>
so users on Cursor get syntax highlighting before Open VSX is live.
Resolves paths via import.meta.url so it works from any cwd.
Six node --test cases asserting the manifest contributes language,
grammar, and snippets for .ilo; that we are not marked private; that
the six brief-required snippets exist; that the language config uses
-- comments and the kebab-case word pattern; that the grammar parses
and declares source.ilo; and that the builtin rule covers core HOFs.

Runs under `npm test` with no external deps.
Extension README points at ilo-lang.ai and documents the install paths
(marketplace once published, Cursor via npm run install:cursor today).
Changelog starts at 0.12.0. .vscodeignore strips tests and scripts from
the published .vsix.

Main README gains an Editor support section under Quick start linking
to the extension directory.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit 4f80bd8 into main May 18, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/vscode-extension branch May 18, 2026 22:25
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