Skip to content

syntax: highlight groovy, gradle, properties, asciidoc, kts - #153

Draft
big-guy wants to merge 1 commit into
ness-dev:mainfrom
big-guy:syntax-highlight-gradle-groovy-asciidoc
Draft

syntax: highlight groovy, gradle, properties, asciidoc, kts#153
big-guy wants to merge 1 commit into
ness-dev:mainfrom
big-guy:syntax-highlight-gradle-groovy-asciidoc

Conversation

@big-guy

@big-guy big-guy commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Adds syntax highlighting for Gradle-ecosystem and AsciiDoc files in both the FileView/diff viewers (highlight.js) and the Monaco file editor.

highlight.js (src/renderer/syntax.ts)

  • Register groovy, properties, and asciidoc languages on top of the common bundle.
  • EXT_TO_LANG: .groovy → groovy, .gradle → groovy, .properties → properties, .adoc/.asciidoc → asciidoc. .gradle.kts resolves to kotlin via its trailing extension.

Monaco editor (src/renderer/monaco-setup.ts + monaco-grammars/)

  • Hand-rolled Monarch grammars for groovy and asciidoc.
  • .groovy/.gvy/.gy/.gsh/.gradle → groovy.
  • .gradle.kts → kotlin (Monaco built-in; compound ext checked before the single-ext fallback).
  • .adoc/.asciidoc → asciidoc; .properties → ini.

Build scripts use the stock Groovy/Kotlin languages rather than bespoke Gradle DSL grammars — so Gradle DSL identifiers (task, dependencies, implementation, …) render as plain identifiers, which is the intended trade-off for not maintaining a parameterized grammar.

Verification

  • npm run typecheck
  • npx electron-vite build ✅ (renderer chunk grows ~a few KB for the two Monarch grammars)

🤖 Generated with Claude Code

PR opened on behalf of @big-guy by Claude via Harness.

Add syntax highlighting for Gradle-ecosystem and AsciiDoc files in both
the FileView/diff viewers (highlight.js) and the Monaco file editor.

highlight.js (src/renderer/syntax.ts):
- register groovy, properties, asciidoc languages
- EXT_TO_LANG: .groovy → groovy, .gradle → groovy, .properties → properties,
  .adoc/.asciidoc → asciidoc; .gradle.kts resolves to kotlin via its ext

Monaco (src/renderer/monaco-setup.ts + monaco-grammars/):
- hand-rolled Monarch grammars for groovy and asciidoc
- .groovy/.gvy/.gy/.gsh/.gradle → groovy
- .gradle.kts → kotlin (built-in; compound ext checked before single)
- .adoc/.asciidoc → asciidoc, .properties → ini

Build scripts use the stock Groovy/Kotlin languages rather than bespoke
Gradle DSL grammars.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@big-guy

big-guy commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

Ideally, we'd do one of these things...

  • Bundle all available highlighters
  • On-demand load the appropriate highlighters
  • Make it pluggable
  • Defer to something else that is configurable in a standard way

This is only just enough to cover the common files I see.

@big-guy big-guy self-assigned this Jun 5, 2026
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