Skip to content

Highlight Elixir and Erlang files in the file editor - #13732

Merged
teamleaderleo merged 5 commits into
manaflow-ai:mainfrom
camilohollanda:file-editor-elixir-erlang-highlighting
Sep 27, 2026
Merged

teamleaderleo merged 5 commits into
manaflow-ai:mainfrom
camilohollanda:file-editor-elixir-erlang-highlighting

Conversation

@camilohollanda

@camilohollanda camilohollanda commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The file editor shows .ex, .erl and .hrl files as plain text, and opens .exs files in the video player. The bundled highlight.js 11.11.1 registers both elixir and erlang, so two things were missing:

  • LanguageCatalog had no entry for these extensions, so they never reached highlighting. This PR maps ex/exs to elixir and erl/hrl to erlang.
  • macOS resolves .exs to com.apple.logic.exs (Logic's sampler instrument format), which conforms to audiovisualContent, so FilePreviewKindResolver routed Elixir scripts to media before the editor. This PR adds ex, exs, erl and hrl to textExtensions, which sends them through the same media-collision sniff .ts already uses. A text .exs opens in the editor; a binary Logic .exs keeps the media route.

.heex/.eex stay unmapped: highlight.js has no grammar for them, and forcing elixir or xml would mis-color the other half of every template.

Testing

  • Commits 1 and 3 add the tests on their own; commits 2 and 4 add the fixes.
  • LanguageCatalogTests.mapsBeamExtensions: swift test in Packages/Shared/CmuxSyntaxHighlighting passes 25 tests in 5 suites.
  • FilePreviewKindResolverTests.beamSourceFilesRouteDirectlyToTextPreview: xcodebuild test -scheme cmux-unit -only-testing:cmuxTests/FilePreviewKindResolverTests passes 5 tests, including the existing .ts/.mts and movie cases.
  • In a tagged Debug build, .ex, .exs and .erl files open highlighted in the editor. Before the routing fix, .exs opened in the video player.
  • I left out an engine-level highlighting test on purpose: Highlightr retries with highlightAuto when a language id is unknown, so a test that looks for colored output passes even when the id is wrong (checked by swapping in elixirx).

Checklist

  • I added or updated tests for behavior changes
  • I tested the change locally (tagged Debug build; .ex/.exs/.erl checked in the editor)
Screenshot 2026-09-23 at 11 36 42 Screenshot 2026-09-23 at 11 38 06 Screenshot 2026-09-23 at 11 52 14

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Highlights Elixir and Erlang source files in the file editor instead of showing them as plain text or opening them as media.

  • Maps ex/exs to elixir and erl/hrl to erlang in the LanguageCatalog.
  • Routes those extensions to the text preview; macOS resolves .exs to Logic's com.apple.logic.exs UTI, which conforms to audiovisualContent and previously opened Elixir scripts as media, so a text .exs opens in the editor while a binary Logic .exs keeps the media route.
  • Leaves .heex and .eex unmapped because highlight.js has no grammar for them and forcing a language would mis-color templates.

Tests cover both the new mappings and the preview routing.

Written for commit 70a22d5. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added syntax highlighting support for Elixir files (.ex, .exs) and Erlang files (.erl, .hrl).
    • Elixir and Erlang files now open in text preview mode.

Changelog

Added: The file editor highlights Elixir (.ex, .exs) and Erlang (.erl, .hrl) files

@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9dd834ad-ba47-4195-8021-138c2476dd8e

📥 Commits

Reviewing files that changed from the base of the PR and between aabbc49 and dc015a0.

📒 Files selected for processing (2)
  • Sources/Panels/FilePreviewPanel.swift
  • cmuxTests/FilePreviewKindResolverTests.swift

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The language catalog maps four BEAM-related extensions to Elixir and Erlang. The file preview resolver classifies .erl, .ex, and .exs files as text. Tests cover the language mappings and text preview behavior.

Changes

BEAM File Extension Support

Layer / File(s) Summary
Language mappings and tests
Packages/Shared/CmuxSyntaxHighlighting/Sources/CmuxSyntaxHighlighting/LanguageCatalog.swift, Packages/Shared/CmuxSyntaxHighlighting/Tests/CmuxSyntaxHighlightingTests/LanguageCatalogTests.swift
The catalog maps ex and exs to Elixir, and erl and hrl to Erlang. Tests verify the highlight.js identifiers.
Text preview classification and tests
Sources/Panels/FilePreviewPanel.swift, cmuxTests/FilePreviewKindResolverTests.swift
The preview resolver adds erl, ex, and exs to its text extension set. Tests check text preview before and after asynchronous resolution.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: austinywang

Merge Risk: ⚪ Minimal · up to dc015

The PR adds Elixir and Erlang syntax mappings and text previews for their source files, including .hrl. The reviewed routing behavior is supported, with no unresolved merge-blocking issue evident.

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS: The pull request changes only syntax-language mappings and file-preview routing for Elixir and Erlang extensions, plus tests. The authoritative diff contains no Cloud terminal creation, transpor…
Cmux Swift Actor Isolation ✅ Passed The production diff only adds four string-to-string entries in LanguageCatalog and four string literals in FilePreviewKindResolver.textExtensions. It does not introduce or modify a model, service …
Cmux Swift Blocking Runtime ✅ Passed The production diff only adds four language-catalog mappings and four text extensions. The added Swift tests create temporary files and use synchronous expectations; they add no blocking or timing pri…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only language mappings, file-preview extension routing, and related tests. It does not modify browser socket commands, processV2Command, socketWorkerMethods, WebKit/…
Cmux Expensive Synchronous Load ✅ Passed PASS. The authoritative diff changes only four files. The production changes add four extension mappings and four text-extension set entries. They do not add or move agent-history loads, session store…
Cmux Cache Substitution Correctness ✅ Passed The diff only adds static extension mappings and text-preview classification. LanguageCatalog reads a built-in dictionary, and FilePreviewKindResolver classifies URLs from their extensions and UTT…
Cmux No Hacky Sleeps ✅ Passed PASS: The pull request changes only Swift source and Swift tests. The authoritative diff adds language mappings, text extensions, and assertions; it introduces no sleeps, timers, polling, delayed disp…
Cmux Algorithmic Complexity ✅ Passed The PR adds four entries to a fixed language dictionary and four entries to a fixed Set<String>. The resolver uses constant-time membership checks for these extensions. The diff adds no nested scala…
Cmux Swift Concurrency ✅ Passed PASS. The PR adds extension mappings, text-extension entries, and synchronous tests only. The added Swift lines introduce no Dispatch queues, Combine state, completion-handler API, or fire-and-forget …
Cmux Swift @Concurrent ✅ Passed The PR adds extension mappings, text-preview routing, and tests. It does not add or change any async, nonisolated, @concurrent, or actor-isolation declaration. The existing file-I/O and mode-res…
Cmux Swift Package Boundaries ✅ Passed PASS. The core extension-to-language mapping is implemented in the existing CmuxSyntaxHighlighting SwiftPM target and covered by its package tests. The only app-target production change adds four en…
Cmux Swiftpm Lockfiles ✅ Passed The pull request changes only Swift source and test files. It does not change any Package.swift dependency declaration, Package.resolved file, Xcode project package reference, .gitignore, or workflow.…
Cmux Swift Logging ✅ Passed The PR adds only language mappings, text-extension entries, and tests. The diff adds no print, debugPrint, dump, NSLog, file/stdout logging, Logger declaration, or sensitive-data log. The logg…
Cmux User-Facing Error Privacy ✅ Passed The pull request does not add or materially change a user-facing error, alert, command output, API error body, or recovery message. The production changes only add Elixir/Erlang language mappings and …
Cmux Full Internationalization ✅ Passed PASS. The diff only adds Elixir/Erlang file-extension and highlight.js identifier mappings, text-preview extension tokens, and tests. It introduces no production user-facing text, localization keys, s…
Cmux Swiftui State Layout ✅ Passed PASS: The pull request does not introduce a SwiftUI state or layout change. Its only application-code change in FilePreviewPanel.swift adds erl, ex, exs, and hrl to the existing `textExtensi…
Cmux Architecture Rethink ✅ Passed The pull request makes a small, local correctness change. It adds four static extension mappings and four text-extension entries, with focused tests. The diff introduces no sleeps, delayed dispatch, p…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The PR does not add or materially change a standalone cmux-owned window. Its Swift changes only add Elixir/Erlang language mappings, text extensions, and tests. No changed line introduces or modifies …
Cmux Source Artifacts ✅ Passed The pull request changes only four intentional Swift source and test files. The diff adds Elixir/Erlang language mappings, text-preview routing, and tests for that behavior. No logs, screenshots, reco…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS. The production diff adds only four language-catalog mappings and four text extensions. It adds no test/debug-only extension or member, test-seam name, wrapper accessor, or visibility widening. E…
Title check ✅ Passed The title clearly summarizes the main change: adding Elixir and Erlang highlighting in the file editor.
Description check ✅ Passed The description is complete and relevant. It explains the problem, implementation, supported extensions, testing commands and results, screenshots, limitations, and changelog entry. Screenshots provid…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

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

@camilohollanda

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document v2.2 and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Sep 22, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator

dw bout the red ci imma rebase

@camilohollanda
camilohollanda force-pushed the file-editor-elixir-erlang-highlighting branch from 8c25210 to aabbc49 Compare September 23, 2026 13:58
@camilohollanda

Copy link
Copy Markdown
Contributor Author

dw bout the red ci imma rebase

@teamleaderleo done

camilohollanda and others added 3 commits September 23, 2026 11:39
.exs resolves to com.apple.logic.exs, which conforms to
audiovisualContent, so the preview opens Elixir scripts as media.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adding ex, exs, erl and hrl to the known text extensions routes them
through the same media-collision sniff as .ts: a text .exs opens in
the editor, while a binary Logic sampler .exs keeps the media route.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo merged commit e2a167a into manaflow-ai:main Sep 27, 2026
65 of 68 checks passed
@teamleaderleo

Copy link
Copy Markdown
Collaborator

Merged, thanks @camilohollanda :)

@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 70a22d5f39, merged 2026-09-27 14:18:27 UTC

  • Not verified at merge: Web complexity (in progress), ios-simulator (ipad) (failure), ios-simulator (iphone) (failure), ios-tests (failure)
  • Verified: app-host unit tests, ci-status, macOS compile admission, web-validation, CI fast guards, CI timing, detect-ios-changes, Fast static checks, GhosttyKit release check, guards (17), ios-simulator-build, linux-preflight, and 8 more
  • Skipped by policy: admission-placement, browser, Claude wrapper regressions, CLI product tests, late-placement, release-admission, release-build, remote-daemon, suite-coverage, tests-build-and-lag, web, web-build, and 2 more
  • Full suite: runs on main after merge.

Labeled merged-unverified: if main breaks near this merge, look here first.

@github-actions github-actions Bot added the merged-unverified A judging check was not green at merge; see the merge receipt comment label Sep 27, 2026
@camilohollanda
camilohollanda deleted the file-editor-elixir-erlang-highlighting branch September 27, 2026 14:53
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 27, 2026
648d5c1 Add a Paste Last Screenshot action with an unbound shortcut (manaflow-ai#14955)
ff61677 ci: avoid partial blobs in catch-up merges (manaflow-ai#15023)
4d0d112 ci: retry transient catch-up GraphQL failures (manaflow-ai#15021)
212e808 ci: attribution scores a lone suspect and reports app-host crashes apart (manaflow-ai#14952)
4cabdf4 test: settle the window before measuring the unread sidebar-row invalidation (manaflow-ai#14568)
12ec99b Add a release-media capture tool for changelog screenshots and clips (manaflow-ai#15010)
ee2cda0 Backfill Unreleased changelog and draft next release cards (manaflow-ai#14999)
be4adf8 Show a brief notice when Cmd+V fails on an oversized image or a timeout (manaflow-ai#14953)
23d22d7 ci: an owned pool the run starts on now beats an earlier one it queues on (manaflow-ai#14993)
05d0190 ci: catch-up posts once per head, says less, and merges inserted declarations (manaflow-ai#15018)
4ee4b21 ci: fail stalled Swift package tests instead of waiting out the job timeout (manaflow-ai#14997)
9ce512a merge-main: run local guards only when asked (manaflow-ai#15016)
d60108a ci: clear test-e2e's fixed DerivedData with clear-dirs.sh (manaflow-ai#14994)
1d7895e ci: run the shell and CLI no-socket lanes in parallel (manaflow-ai#14990)
6e7d25f Honor macOS Differentiate Without Color, Increase Contrast and Reduce Transparency (manaflow-ai#14991)
966b355 Stop interrupting focused work: sidebar jumps, Computer Use focus steal, quit dialog on logout (manaflow-ai#14961)
e1f1cb2 Strip control characters from feedback attachment filenames (manaflow-ai#14783)
0758c9f test: find the onboarding window the test presented, not a leftover (manaflow-ai#15015)
b35c540 fix(spm): resolve GhosttyKit/GhosttyRuntimeTestStubs target name collisions (manaflow-ai#10569)
ef33bed Map .purs artifacts to the Haskell highlight.js grammar (manaflow-ai#14202)
e2a167a Highlight Elixir and Erlang files in the file editor (manaflow-ai#13732)
972c449 fix: wrap Linux browser download card label (manaflow-ai#11157)
f563884 Add Aside to browser data import detection (manaflow-ai#13379)
091d0ea Add cmux send --paste and hint at it for large multi-line sends (manaflow-ai#14937)
3ffcdbb test(ios): keep folder-tap stat tests off the real 2 s deadline (manaflow-ai#15017)
68d3936 test: keep CmuxTerminal pasteboard tests off the cooperative pool (manaflow-ai#15006)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-unverified A judging check was not green at merge; see the merge receipt comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants