[BUG] No syntax highlighting for GDScript (.gd) files

Status Open
Reported on v2.1.108
Maintainer reply None cached
Activity 7 comments · opened Apr 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

GDScript (.gd) files have no syntax highlighting in code blocks and diffs. All GDScript code appears as plain white text. Other languages (TypeScript, Python, Rust) are highlighted correctly in the same session.

What Should Happen?

GDScript code should have syntax highlighting (keywords, strings, numbers, types colored) similar to other supported languages.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code CLI in iTerm2
  2. Ask Claude to create/edit a .gd file and a .ts file
  3. Compare the diff output — .ts has colors, .gd is plain white

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown

Claude Code Version

2.1.108

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Code in same session:
<img width="512" height="368" alt="Image" src="https://github.com/user-attachments/assets/e76fa00b-30a8-4984-970e-7b4c7d5adc0c" />

Screenshot from some old version with working highlight:
<img width="494" height="184" alt="Image" src="https://github.com/user-attachments/assets/db3b6c8b-4140-4769-b8e2-27aa8a42ea83" />

View original on GitHub ↗

6 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/39805
  2. https://github.com/anthropics/claude-code/issues/28192
  3. https://github.com/anthropics/claude-code/issues/21834

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

pestushka · 4 months ago

Not a duplicate.
Linked issues are about syntax highlighting being broken globally (all languages affected).
This issue is specifically about GDScript (.gd files) not having a grammar registered.
Other languages (TypeScript, Python, Rust, etc.) highlight correctly in the same session.

pestushka · 3 months ago

Still reproducible on 2.1.114
Confirmed regression, worked in earlier versions (see second screenshot above).

This is not a duplicate of #39805 / #28192 / #21834 those describe highlighting being broken globally across all languages.
Here only .gd files are affected, TS / Python / Rust render correctly in the same session (see first screenshot).

Likely root cause: no GDScript grammar registered in the TUI highlighter bundle. Official MIT-licensed TextMate grammar: https://github.com/godotengine/godot-vscode-plugin/blob/master/syntaxes/GDScript.tmLanguage.json

pestushka · 3 months ago

Cross-device reproduction + drop-in fix proposal

Not local - reproduced on multiple machines

Asked another developer to repro independently on a separate machine - different hardware, fresh Claude Code install, no shared config or settings. Same result: .gd diffs render as plain white while .ts / .py / .rs are colored correctly in the same session. Rules out my local environment, theme, terminal, or extension shadowing.

Highlighter stack

Confirmed via strings on the bundled binary: Claude Code TUI uses highlight.js for code/diff rendering. highlight.js ships ~190 grammars, but GDScript is not in the default set - that's the regression surface.

Drop-in fix (~10 lines)

Official community grammar exists and is maintained by the highlight.js org itself:

Repo: https://github.com/highlightjs/highlightjs-gdscript
License: BSD-3-Clause (compatible)
Author: maintained by highlightjs org + Calinou (Godot core contributor)

Integration matches the standard third-party grammar pattern:

import hljs from 'highlight.js';
import gdscript from './vendor/highlightjs-gdscript/dist/gdscript.min.js';

hljs.registerLanguage('gdscript', gdscript);

Plus an extension → language entry: '.gd' → 'gdscript' in whatever extension map the diff renderer uses.

That's the entire patch. No new dependency in package.json needed (single ~5KB JS file can be vendored), no behavior change for any other language, and .tres / .tscn files can map to the same grammar or ini as a separate follow-up.

pestushka · 2 months ago

Still reproducible on v2.1.170

pestushka · 1 month ago

Still reproducible on v2.1.202

Showing cached comments. Read the full discussion on GitHub ↗