mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-12 13:02:54 -05:00
fix: Remove check empty file for edit tool
This commit is contained in:
@ -701,14 +701,6 @@ bool ChangesManager::performFragmentReplacement(
|
||||
bool isUndo)
|
||||
{
|
||||
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;
|
||||
|
||||
if (isAppendOperation) {
|
||||
|
||||
@ -56,10 +56,11 @@ QString EditFileTool::description() const
|
||||
"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. "
|
||||
"\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 "
|
||||
"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."
|
||||
"\n- To append at the END of file, use empty old_content."
|
||||
"\n- For replacements in the middle, provide EXACT matching text with sufficient "
|
||||
"context (at least 5-10 lines) to ensure correct placement."
|
||||
"\n- The system requires 85% similarity for first-time edits. Provide accurate "
|
||||
|
||||
Reference in New Issue
Block a user