TextEditor: Use DocumentManager when storing open documents

... in RefactoringFile.
Otherwise, the file system watchers might emit unexpected "changed"
signals for these files, which we don't want, because they can lead to
e.g. unnecessary clangd restarts.
For some reason, this problem only started manifesting itself after
740bde9516.

Change-Id: Ic613ce6d52ba151fb54f79cbc57f92bee9968ec6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2024-11-22 16:09:05 +01:00
parent 22a18e5e36
commit f5c55885d4

View File

@@ -280,7 +280,7 @@ bool RefactoringFile::apply()
fileChanged();
if (withUnmodifiedEditor && EditorManager::autoSaveAfterRefactoring())
m_editor->textDocument()->save(m_filePath, false);
DocumentManager::saveDocument(m_editor->textDocument(), m_filePath);
}
}