mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
fix: Ensure filename is available for diff rendering in write-file
This commit resolves a bug where the `write-file` operation could fail to render content due to a missing filename. The fix involves: - Ensuring `fileName` is consistently passed to `DiffRenderer.tsx` through `ToolConfirmationMessage.tsx`, `ToolMessage.tsx`, and `useGeminiStream.ts`. - Modifying `edit.ts` and `write-file.ts` to include `fileName` in the `FileDiff` object. - Expanding the `FileDiff` interface in `tools.ts` to include `fileName`. Additionally, this commit enhances the diff rendering by: - Adding syntax highlighting based on file extension in `DiffRenderer.tsx`. - Adding more language mappings to `getLanguageFromExtension` in `DiffRenderer.tsx`. - Added lots of tests for all the above. Fixes https://b.corp.google.com/issues/418125982
This commit is contained in:
committed by
N. Taylor Mullen
parent
dce7d2c4f7
commit
968e09f0b5
+1
-1
@@ -16,7 +16,7 @@
|
||||
"debug": "NODE_ENV=development DEBUG=1 scripts/start.sh",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"lint": "eslint . --ext .ts,.tsx",
|
||||
"typecheck": "tsc --noEmit --jsx react-jsx",
|
||||
"typecheck": "npm run typecheck --workspaces --if-present",
|
||||
"format": "prettier --write .",
|
||||
"preflight": "npm run format --workspaces --if-present && npm run lint && npm run test --workspaces --if-present",
|
||||
"auth:npm": "npx google-artifactregistry-auth",
|
||||
|
||||
Reference in New Issue
Block a user