[BUG] No syntax highlighting for GDScript (.gd) files
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
- Open Claude Code CLI in iTerm2
- Ask Claude to create/edit a .gd file and a .ts file
- 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" />
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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.
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
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:
.gddiffs render as plain white while.ts/.py/.rsare colored correctly in the same session. Rules out my local environment, theme, terminal, or extension shadowing.Highlighter stack
Confirmed via
stringson the bundled binary: Claude Code TUI uses highlight.js for code/diff rendering.highlight.jsships ~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
highlightjsorg + Calinou (Godot core contributor)Integration matches the standard third-party grammar pattern:
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.jsonneeded (single ~5KB JS file can be vendored), no behavior change for any other language, and.tres/.tscnfiles can map to the same grammar orinias a separate follow-up.Still reproducible on v2.1.170
Still reproducible on v2.1.202