pi-mono/packages/coding-agent/src
robopipi[bot] c13f6acfbe
Highlight .dart, .nix, and .groovy files in read/write views (#11790)
The `read` and `write` tool views find a file's language from its
extension with `getLanguageFromPath()`. That function's extension table
had no entries for Dart, Nix, or Groovy. Their highlight.js grammars are
loaded at startup, but the lookup returned `undefined`, so these files
were shown as plain uncolored text.

This change adds `dart → dart`, `nix → nix`, `groovy → groovy`, and
`gradle → groovy` to the table in
`packages/coding-agent/src/modes/interactive/theme/theme.ts`.

HTML export keeps its own separate extension map and a vendored
highlight bundle without a Dart grammar. This change does not touch
either.

## Testing

- Added a test to `test/syntax-highlight.test.ts` that checks the new
extension mappings. It fails without the fix and passes with it.
- `node ../../node_modules/vitest/dist/cli.js --run
test/syntax-highlight.test.ts` passes.
- Before, `getLanguageFromPath("a.dart")` (and `.nix`, `.groovy`,
`build.gradle`) returned `undefined` from the built dist. After, they
return `dart`, `nix`, `groovy`, and `groovy`.
- `npm run check` reports 6 type errors in `packages/ai/test` (model ID
types). Main without this change has the same 6 errors.

Fixes #11643

Requested by @badlogic

Co-authored-by: triagent <triagent@localhost>
2026-11-04 10:45:55 +01:00
..
bun feat(coding-agent): codemode and MCP 2026-09-29 09:12:50 +02:00
cli fix(coding-agent): load user keybindings in pi config (#11788) 2026-11-04 09:59:49 +01:00
core fix(coding-agent): clear delivered image-only queue entries (#8612) 2026-11-04 10:24:43 +01:00
experimental feat(coding-agent): remove the experimental server stack and the client, protocol, and server packages 2026-10-12 10:41:59 +00:00
extensions fix(coding-agent): name the llama.cpp server and cause when it cannot be reached (#11779) 2026-11-04 09:32:51 +01:00
modes Highlight .dart, .nix, and .groovy files in read/write views (#11790) 2026-11-04 10:45:55 +01:00
utils fix(coding-agent): ignore prerelease suffix of last seen changelog version (#11753) 2026-11-03 21:59:05 +01:00
cli.ts fix(coding-agent): keep remote harness dependencies development-only 2026-09-05 12:45:04 +02:00
config.ts feat(coding-agent): add PI_SELF_UPDATE_COMMAND and selfUpdateCommand for pi update (#11629) 2026-10-30 22:30:39 +01:00
index.ts feat(coding-agent): let Markdown transformers opt into more surfaces (#11756) 2026-11-03 23:10:47 +01:00
main.ts fix(coding-agent): dispose session runtime after startup benchmark (#11736) 2026-11-03 22:11:40 +01:00
migrations.ts fix(coding-agent): update repository links to "earendil-works/pi" (#9278) 2026-09-07 14:09:39 +02:00
package-manager-cli.ts fix(coding-agent): only report packages as up to date when pi update checked them (#11711) 2026-11-02 21:49:07 +01:00
rpc-entry.ts feat(coding-agent): set AI_AGENT environment variable (#7493) 2026-08-03 13:45:32 +02:00