ADFA-4436 Add RainbowOnTheGo plugin (depth-colored brackets)#32
Merged
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
e86c1c6 to
66ac9b7
Compare
A plugin that colors matching parentheses, brackets, and braces by nesting depth. It implements the generic EditorDecorationProvider API: its decorate() method scans a region of editor text for brackets, tracks nesting depth, skips brackets inside strings/comments, and returns six-color day/night spans. The Code On The Go editor merges those spans on top of normal highlighting — all of the rainbow logic lives in the plugin; the IDE knows nothing about brackets. Mirrors the random-xkcd template: build.gradle.kts/settings.gradle.kts, AndroidManifest plugin.* metadata, DocumentationExtension tooltip + Tier-3 in-IDE help, and a top-level documentation HTML. Adds an Examples table row. No UI, no permissions, no network. Requires a Code On The Go build that includes the EditorDecorationProvider API (IDE-side support in ADFA-4436).
66ac9b7 to
8898d93
Compare
added 2 commits
June 26, 2026 12:17
…version - Add rainbow-on-the-go to the deploy MAP in update-libs.yml so its .cgp ships to the plugins website (auto-discovered by build-plugins.yml). - Set plugin.min_ide_version to 26.27 (when the new plugin API ships). - Correct CLAUDE.md: new plugins only need the update-libs.yml MAP; build-plugins.yml auto-discovers.
- Collapse the prefix-recovery and emitting scans into one shared lexer so they can't diverge; apply the newline reset uniformly (a // comment or string no longer suppresses coloring for the rest of a multi-line region). - Restrict coloring to Java/Kotlin via FileOpenExtension (observe-only; canHandleFileOpen=false). Gate defaults off, so other languages are never colored. Drop the #-as-comment rule (wrong for Java/Kotlin). - Add a per-document checkpoint cache so decorate() resumes prefix lexing from the nearest cached offset instead of rescanning [0,start) every call, turning sequential decoration from ~O(N^2) into ~O(N). - Update manifest/docs to say Java/Kotlin only and reflect file-open observation (reads no file contents).
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
Adds RainbowOnTheGo, a plugin that colors matching parentheses, brackets, and braces by nesting depth (red → orange → yellow → green → blue → purple), with separate palettes for the light and dark editor themes.
It implements the generic
EditorDecorationProviderAPI. Itsdecorate(text, start, end, isDark)method does everything itself — scans the text for brackets, tracks nesting depth (skipping strings/comments), and returns foreground-color spans — and the Code On The Go editor merges them on top of the normal highlighting. The IDE has no knowledge of brackets, depth, or palettes; all of that lives in the plugin.What it contains
RainbowOnTheGoPlugin—IPlugin+EditorDecorationProvider+DocumentationExtension(Tier 1/2 tooltip + Tier 3 offline help underassets/docs/).random-xkcd:build.gradle.kts/settings.gradle.kts,AndroidManifest.xmlplugin.*metadata, top-levelrainbow-on-the-go-documentation.html.Verification
./gradlew assemblePlugin→rainbow-on-the-go.cgpbuilds clean.(),[],{}in Java; nesting depth carried across lines; brackets in strings/comments excluded; day and night palettes; live theme toggle; revert-on-disable.Dependency
Requires a Code On The Go build that includes the
EditorDecorationProviderAPI (IDE-side support in ADFA-4436, appdevforall/CodeOnTheGo#1448). The plugin compiles against the refreshedplugin-api.jar.min_ide_versionis currently a placeholder (1.0.0) and should be bumped to the first release that ships the API once that PR lands.(Reworked from an earlier palette-only
BracketColorExtensionplugin after review feedback: the IDE-side API is now generic and all rainbow logic lives in the plugin.)