mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-12 21:12:44 -05:00
fix: Remove check empty file for edit tool
This commit is contained in:
@ -701,14 +701,6 @@ bool ChangesManager::performFragmentReplacement(
|
|||||||
bool isUndo)
|
bool isUndo)
|
||||||
{
|
{
|
||||||
QString currentContent = readFileContent(filePath);
|
QString currentContent = readFileContent(filePath);
|
||||||
if (currentContent.isNull()) {
|
|
||||||
if (errorMsg) {
|
|
||||||
*errorMsg = "Failed to read current file content";
|
|
||||||
}
|
|
||||||
LOG_MESSAGE(QString("Failed to read file for fragment replacement: %1").arg(filePath));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString resultContent;
|
QString resultContent;
|
||||||
|
|
||||||
if (isAppendOperation) {
|
if (isAppendOperation) {
|
||||||
|
|||||||
@ -56,10 +56,11 @@ QString EditFileTool::description() const
|
|||||||
"and new_content to replace it with. Changes are applied immediately if auto-apply "
|
"and new_content to replace it with. Changes are applied immediately if auto-apply "
|
||||||
"is enabled in settings. The user can undo or reapply changes at any time. "
|
"is enabled in settings. The user can undo or reapply changes at any time. "
|
||||||
"\n\nIMPORTANT:"
|
"\n\nIMPORTANT:"
|
||||||
|
"\n- For EMPTY files: use empty old_content (empty string or omit parameter)."
|
||||||
|
"\n- To append at the END of file: use empty old_content."
|
||||||
"\n- To insert at the BEGINNING of a file (e.g., copyright header), you MUST provide "
|
"\n- To insert at the BEGINNING of a file (e.g., copyright header), you MUST provide "
|
||||||
"the EXACT first few lines of the file as old_content (at least 3-5 lines), "
|
"the EXACT first few lines of the file as old_content (at least 3-5 lines), "
|
||||||
"then put those lines + new header in new_content."
|
"then put those lines + new header in new_content."
|
||||||
"\n- To append at the END of file, use empty old_content."
|
|
||||||
"\n- For replacements in the middle, provide EXACT matching text with sufficient "
|
"\n- For replacements in the middle, provide EXACT matching text with sufficient "
|
||||||
"context (at least 5-10 lines) to ensure correct placement."
|
"context (at least 5-10 lines) to ensure correct placement."
|
||||||
"\n- The system requires 85% similarity for first-time edits. Provide accurate "
|
"\n- The system requires 85% similarity for first-time edits. Provide accurate "
|
||||||
|
|||||||
Reference in New Issue
Block a user