Skip to content

Add syntax highlighting for Glimmer JS/TS (.gts/.gjs) files in diffs

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Release notes

Add syntax highlighting support for Glimmer JS/TS (.gts/.gjs) files in diff views to complement the existing blob viewer highlighting.

Problem to solve

While syntax highlighting for Glimmer JS/TS files was added to the blob viewer in !174877 (merged), diffs for these files are not syntax highlighted because Rouge (the syntax highlighter used for diffs) doesn't support Glimmer yet.

This creates an inconsistent experience where:

  • .gjs and .gts files have syntax highlighting in the blob viewer
  • The same files show no syntax highlighting in merge request diffs, commit diffs, or other diff views

Proposal

Add Glimmer JS/TS syntax highlighting support to Rouge or implement an alternative solution for diff highlighting of .gjs and .gts files.

Implementation Guide

There are currently two open PRs on Rouge's repository that would add Glimmer support:

Potential approaches:

  1. Wait for upstream Rouge support: Monitor the Rouge PRs and update GitLab's Rouge dependency once merged
  2. Contribute to Rouge: Help get one of the existing PRs merged upstream
Edited by Jacques Erasmus