Skip to content

fix(tui): highlight C++ module files - #28554

Merged
fcoury-oai merged 3 commits into
mainfrom
codex/fix-cpp-module-highlighting
Jun 16, 2026
Merged

fix(tui): highlight C++ module files#28554
fcoury-oai merged 3 commits into
mainfrom
codex/fix-cpp-module-highlighting

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Why

Codex syntax-highlights diffs for conventional C++ extensions such as .cpp and .cxx, but C++ module interface files using .cppm, .ixx, or .cxxm fall back to plain diff coloring. The bundled syntax set already includes C++, but it does not resolve those module extensions by itself.

Closes #28223.

What changed

  • map .cppm, .ixx, and .cxxm to the existing cpp syntax in render/highlight.rs
  • extend alias-resolution coverage for all three module extensions
  • verify .cpp, .cppm, .ixx, and .cxxm diffs produce syntax-highlighted RGB spans while unknown extensions retain the plain fallback
  • snapshot the syntax-colored token segmentation for the supported C++ module extensions

How to Test

  1. Ask Codex to create or modify a C++ module interface file using .cppm, .ixx, or .cxxm.
  2. Confirm C++ tokens in the rendered diff receive syntax colors instead of only the red/green diff treatment.
  3. Modify an equivalent .cpp file and confirm its existing highlighting remains unchanged.
  4. Modify a file with an unknown extension and confirm it still uses the plain diff fallback.

Targeted tests:

  • just test -p codex-tui -E 'test(find_syntax_resolves_languages_and_aliases) | test(cpp_module_extensions_use_cpp_highlighting) | test(unknown_extension_falls_back_without_syntax_highlighting)'

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11b37e75d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/diff_render.rs
Comment thread codex-rs/tui/src/render/highlight.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13b40b2b4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/render/highlight.rs
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 8488219425

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai etraut-openai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code looks good.

I didn't bother building or manually testing this one since it's pretty simple and has low regression risk.

@fcoury-oai
fcoury-oai enabled auto-merge (squash) June 16, 2026 17:29
@fcoury-oai
fcoury-oai merged commit 3ded846 into main Jun 16, 2026
31 checks passed
@fcoury-oai
fcoury-oai deleted the codex/fix-cpp-module-highlighting branch June 16, 2026 17:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Many C++ module filetypes don't get syntax highlighting

2 participants