vscode: ship language extension with syntax + snippets + cursor install#410
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 atextensions/vscode/. Mirrorszero/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": trueand 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 thevscepublisher 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:
ilo-site/, writepackage.json(publisherilo-lang, nameilo-lang, version 0.12.0, NOT private) andlanguage-configuration/ilo.jsonwith ilo's--line comments, kebab-case word pattern, and bracket auto-close.fn,tool,match,let,loop,guard,type,tern) covering the highest-friction patterns. Kept minimal; prefix notation should stay short.scripts/install-cursor-extension.mjsmirrors Zero's, copies the extension into~/.cursor/extensions/so Cursor users can run it before Open VSX is live. Usesimport.meta.urlso it works from any cwd.node --testcases 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 + namessource.ilo. No external deps.ilo-lang.ai, main README gets an "Editor support" section.Test plan
cd extensions/vscode && npm test- 6/6 passpackage.jsonvalid JSON, no"private": trueilo, extensions[".ilo"], scopesource.ilo, snippets at./snippets/ilo.code-snippetssource.ilo, covers comments / strings / numbers / type sigils / builtins / keywords / operatorsnpm run install:cursor, open anexamples/*.ilofile, 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)
vscepublisher account forilo-langand 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.ilo-lang/ilo-sitestill readsilo.tmLanguage.jsonfrom 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.examples/*.iloopen in VS Code after install.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.