Skip to content

Register TypeScript, Java and Go grammars for the Dag Code tab - #74231

Merged
pierrejeambrun merged 2 commits into
apache:mainfrom
astronomer:monaco-dag-code-language-highlighting
Oct 5, 2026
Merged

pierrejeambrun merged 2 commits into
apache:mainfrom
astronomer:monaco-dag-code-language-highlighting

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

The Code tab already asks Monaco for whichever language the Dag's source reports (DAGSourceResponse.language, already set to "python", "typescript" or "java" by the respective Dag importers). But Monaco's minimal entry point only ever registered Python's tokenizer, so a Dag authored in TypeScript or Java rendered as flat, unhighlighted text instead of real syntax coloring. Go is registered too, ahead of a Go Dag importer.

  • Before: entirely monochrome, no coloring at all.
  • After: proper keyword/string/comment coloring, same as Python already had.

Before

Screenshot 2026-10-05 at 14 18 05

After

Screenshot 2026-10-05 at 14 29 24
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

The Code tab already asks Monaco for whichever language the Dag source
reports (Python, TypeScript, Java, Go), but the editor's minimal entry
point only ever registered Python's tokenizer. A Dag authored in one of
the other three languages fell back to Monaco's unhighlighted default
rendering instead of real syntax coloring.
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Oct 5, 2026
@pierrejeambrun
pierrejeambrun marked this pull request as ready for review October 5, 2026 12:29
Two near-identical registration blocks, one for Python and one for the
rest, made it read as if Python were the odd one out needing no patch.
It is the only one that does.

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice to see the vivid TS SDK Dag code on the UI! Thanks.

@guan404ming guan404ming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Non-blocking: I think adding a small vitest importing the typescript, java and go grammar modules could help catch export-shape drift in CI.

@pierrejeambrun pierrejeambrun added this to the Airflow 3.4.0 milestone Oct 5, 2026
@pierrejeambrun
pierrejeambrun merged commit d6ab1aa into apache:main Oct 5, 2026
90 checks passed
@pierrejeambrun
pierrejeambrun deleted the monaco-dag-code-language-highlighting branch October 5, 2026 13:45
@pierrejeambrun

Copy link
Copy Markdown
Member Author

Non-blocking: I think adding a small vitest importing the typescript, java and go grammar modules could help catch export-shape drift in CI.

Let me follow up with such a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants