-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: preserve C# generics and angle brackets in write_to_file tool #6771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ import { stripLineNumbers, everyLineHasLineNumbers } from "../../integrations/mi | |
| import { getReadablePath } from "../../utils/path" | ||
| import { isPathOutsideWorkspace } from "../../utils/pathUtils" | ||
| import { detectCodeOmission } from "../../integrations/editor/detect-omission" | ||
| import { unescapeHtmlEntities } from "../../utils/text-normalization" | ||
| import { DEFAULT_WRITE_DELAY_MS } from "@roo-code/types" | ||
| import { EXPERIMENT_IDS, experiments } from "../../shared/experiments" | ||
|
|
||
|
|
@@ -83,10 +82,6 @@ export async function writeToFileTool( | |
| newContent = newContent.split("\n").slice(0, -1).join("\n") | ||
| } | ||
|
|
||
| if (!cline.api.getModel().id.includes("claude")) { | ||
| newContent = unescapeHtmlEntities(newContent) | ||
| } | ||
|
|
||
| // Determine if the path is outside the workspace | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good fix removing the HTML entity unescaping. However, I noticed that |
||
| const fullPath = relPath ? path.resolve(cline.cwd, removeClosingTag("path", relPath)) : "" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a comment here explaining why we don't unescape HTML entities (to preserve code exactly as written, especially for languages like C# with generics). This would help prevent future developers from re-introducing this logic thinking it was an oversight. |
||
| const isOutsideWorkspace = isPathOutsideWorkspace(fullPath) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These test cases for C# generics and HTML entities look good. Consider adding a test case for mixed content (e.g., actual HTML with entities alongside C# code) to ensure we're not breaking legitimate HTML entity usage in edge cases?