Repository navigation
Conversation
Register `ocaml` as a TextMate-backed Monaco language covering `.ml`, `.mli` and `.ocamlinit`, using the vendored ocamllabs/vscode-ocaml-platform grammars (ISC). `.mli` shares the `.ml` language id: `source.ocaml#bindings` includes `source.ocaml.interface#bindings`, so one registration covers both. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Register `ocaml.mlx` for `.mlx` files using the vendored MLX grammar from the same ocamllabs/vscode-ocaml-platform release. MLX is OCaml with JSX expressions, and its grammar is a superset of the OCaml rules rather than an include of them, so it needs its own scope; the language configuration is shared with OCaml, matching upstream. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds OCaml and OCaml MLX language detection and file icons. It adds TextMate grammars for implementation, interface, and MLX syntax. It registers both languages with Monaco and loads grammars by scope. It adds shared tokenization utilities and fixtures for OCaml syntax, signatures, and JSX expressions. Tests cover registration, grammar loading, token scopes, state cleanup, language detection, and shared Oniguruma loading. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 9 files. (7 skipped: 7 unsupported.) Full details: Description checkExplanation The description follows the required template and explains the change, rationale, linked issue, visual proof, testing, AI disclosure, compatibility considerations, and checklist status. It also explains why manual testing was not performed on other platforms. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thank you @rusty-key for this! We've shipped OCaml and MLX as the official OCaml Syntax plugin instead of building it into Orca, so it can be updated on its own. It uses the same OCaml Platform grammars. Your work is credited: you're a co-author of the plugin commit. To install: Settings → Plugins → turn on plugins → search for it and install. It needs Orca 1.4.246 or newer (older versions show "Needs Orca 1.4.246"), because that's the first release where an enabled plugin syntax takes precedence over Orca's own mapping for these files. Closing this PR as superseded. If it falls short for you, please reopen and tell us what is missing. |
Highlights .ml, .mli and .mlx files, with ocamldoc comments, using the OCaml Platform's TextMate grammars (ISC). Needs Orca 1.4.246, the first release where an enabled plugin syntax beats Orca's F# mapping for .ml/.mli. Replaces stablyai/orca#16421 for stablyai/orca#16416. Co-authored-by: Rusty.Key <[email protected]>
ELI5
Orca's editor treats OCaml (
.ml,.mli,.ocamlinit) and MLX (.mlx, OCaml with JSX) files as plain text. This adds syntax highlighting for both.What Changed
ocamlandocaml.mlxas Monaco languages, backed by TextMate grammars vendored from ocamllabs/vscode-ocaml-platform (ISC license)..ml/.mli/.ocamlinitmap toocaml;.mlxgets its own language id and grammar because MLX's grammar is a superset of OCaml's rather than an include of it..ml/.mli/.mlx/.ocamlinit.Why
OCaml and MLX files currently render with no highlighting, unlike every other mainstream language Orca supports.
Linked Issue
Fixes #16416
Visual Proof
Before:

After:

Testing
detectLanguagecoverage for the new extensions and the.ocamlinitexact-name case.Platform tested: macOS. The change is UI-only (Monaco language registration + static data tables) with no OS-specific code path, so I did not test Linux/Windows/SSH separately.
pnpm lint,pnpm typecheckpass.pnpm test: no failures in any file this PR touches; the full suite currently has pre-existing failures unrelated to this change (git-binary integration tests, fish-shell/node-pty tests, macOS keychain tests, electron-vite dev server tests) that reproduce identically onmainwithout these commits.AI Disclosure
Implementation, tests, and this description were done with Claude Code (Claude Opus 5), with review and direction from me throughout.
Review
Agent skill upstream boundary
Notes
UI-only change (Monaco language registration, static extension/icon tables). No SSH, mobile, or backwards-compatibility surface; no hot-path or startup cost — grammars load lazily on first
.ml/.mlxopen, confirmed via existing build output (they land in their own async chunk, not the renderer entry).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)