openai / openai/codex

[IDE] Dart fenced code blocks are not syntax-highlighted because Dart is omitted from the language registry

Open Beginner friendly
#42,221 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug extension
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the IDE extension are you using?

openai.chatgpt-26.825.51511-darwin-arm64

Bundled Codex CLI: 0.151.0-alpha.7.2

What subscription do you have?

ChatGPT Plus

Which IDE are you using?

Visual Studio Code

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

Fenced Dart code blocks in the Codex chat panel are not syntax-highlighted as Dart.

The extension already ships a Dart grammar asset (webview/assets/dart-CZAGdHom.js), but Dart is missing from the highlightLanguages registry exported by the packaged highlight-code-*.js module. The registry contains languages such as TypeScript, Kotlin, and Swift, but no dart entry.

A direct check against the stock highlighter module shows:

dart registered: false
Could not find the language 'dart', did you forget to load/include a language module?
highlight failed: Unknown language: "dart"
typescript registered: true

This appears to be a language-registration omission rather than a missing grammar dependency.

What steps can reproduce the bug?
  1. Install or enable Codex IDE extension 26.825.51511 in VS Code.

  2. Open the Codex chat panel.

  3. Ask Codex to return a fenced Dart code block, for example:

    Show this code in a fenced `dart` code block:
    
    void main() {
      final message = 'hello';
      print(message);
    }
    
  4. Observe that the Dart block does not receive Dart syntax highlighting.

  5. Compare it with an equivalent fenced typescript, kotlin, or swift block.

For an implementation-level reproduction, import the packaged highlight-code-*.js module and check:

Object.hasOwn(highlightLanguages, "dart"); // false
highlightCode('void main() {}', 'dart');   // throws Unknown language: "dart"
What is the expected behavior?

Fenced code blocks tagged with dart should use the Dart grammar that is already bundled with the extension and render with normal token highlighting.

dart should be present in the exported language registry and accepted by highlightCode without an unknown-language error.

Additional information

The likely fix is to import the already-shipped Dart grammar and add it to highlightLanguages before languages are registered.

Related but distinct issues:

  • #32616 tracks broader App/CLI language parity and cites Zig/Odin, not this IDE-specific Dart registration omission.
  • #41659 tracks a recent VS Code regression where even registered languages such as Java render monochrome.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the source that produces the packaged highlight-code-*.js module and compare it with the existing webview/assets/dart-CZAGdHom.js grammar asset. Check how highlightLanguages registers other languages, then verify the direct reproduction: dart is present in the registry and highlightCode(..., "dart") no longer throws an unknown-language error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, javascript, vscode
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.