Skip to content

ADFA-4436 Add RainbowOnTheGo plugin (depth-colored brackets)#32

Merged
hal-eisen-adfa merged 3 commits into
mainfrom
ADFA-4436-rainbow-parens
Jun 26, 2026
Merged

ADFA-4436 Add RainbowOnTheGo plugin (depth-colored brackets)#32
hal-eisen-adfa merged 3 commits into
mainfrom
ADFA-4436-rainbow-parens

Conversation

@hal-eisen-adfa

@hal-eisen-adfa hal-eisen-adfa commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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 EditorDecorationProvider API. Its decorate(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

  • RainbowOnTheGoPluginIPlugin + EditorDecorationProvider + DocumentationExtension (Tier 1/2 tooltip + Tier 3 offline help under assets/docs/).
  • Standard scaffolding mirroring random-xkcd: build.gradle.kts / settings.gradle.kts, AndroidManifest.xml plugin.* metadata, top-level rainbow-on-the-go-documentation.html.
  • No UI surface, no permissions, no network, no native code.
  • Examples table row added to the repo README.

Verification

  • ./gradlew assemblePluginrainbow-on-the-go.cgp builds clean.
  • Device-verified on an emulator: depth cycling across (), [], {} 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 EditorDecorationProvider API (IDE-side support in ADFA-4436, appdevforall/CodeOnTheGo#1448). The plugin compiles against the refreshed plugin-api.jar.

min_ide_version is 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 BracketColorExtension plugin after review feedback: the IDE-side API is now generic and all rainbow logic lives in the plugin.)

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hal-eisen-adfa hal-eisen-adfa force-pushed the ADFA-4436-rainbow-parens branch from e86c1c6 to 66ac9b7 Compare June 25, 2026 07:28
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).
@hal-eisen-adfa hal-eisen-adfa force-pushed the ADFA-4436-rainbow-parens branch from 66ac9b7 to 8898d93 Compare June 25, 2026 07:37
Hal Eisen 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).
@hal-eisen-adfa hal-eisen-adfa merged commit 602f071 into main Jun 26, 2026
@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-4436-rainbow-parens branch June 26, 2026 23:18
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