diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index 19e1df4dd16..b7e62d6e055 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -252,10 +252,8 @@ void ClangdFindReferences::Private::handleRenameRequest( { const Utils::FilePaths filePaths = BaseFileFind::replaceAll(newSymbolName, checkedItems, preserveCase); - if (!filePaths.isEmpty()) { - DocumentManager::notifyFilesChangedInternally(filePaths); + if (!filePaths.isEmpty()) SearchResultWindow::instance()->hide(); - } const auto renameFilesCheckBox = qobject_cast(search->additionalReplaceWidget()); QTC_ASSERT(renameFilesCheckBox, return); diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 2631a853996..4f93e537f70 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -691,13 +691,10 @@ void SymbolSupport::handleRenameResponse(Core::SearchResult *search, void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, Core::SearchResult *search) { - QSet affectedNonOpenFilePaths; QMap> editsForDocuments; QList changes; for (const Utils::SearchResultItem &item : checkedItems) { const auto filePath = Utils::FilePath::fromUserInput(item.path().value(0)); - if (!m_client->documentForFilePath(filePath)) - affectedNonOpenFilePaths << filePath; const QJsonObject jsonObject = item.userData().toJsonObject(); if (const TextEdit edit(jsonObject); edit.isValid()) editsForDocuments[filePath] << edit; @@ -715,10 +712,6 @@ void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, for (auto it = editsForDocuments.begin(), end = editsForDocuments.end(); it != end; ++it) applyTextEdits(m_client, it.key(), it.value()); - if (!affectedNonOpenFilePaths.isEmpty()) { - Core::DocumentManager::notifyFilesChangedInternally(Utils::toList(affectedNonOpenFilePaths)); - } - const auto extraWidget = qobject_cast(search->additionalReplaceWidget()); QTC_ASSERT(extraWidget, return); if (!extraWidget->shouldRenameFiles()) diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 4bda6757745..8ddadeb7c7e 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -388,7 +388,6 @@ void BaseFileFind::doReplace(const QString &text, const SearchResultItems &items if (!files.isEmpty()) { FadingIndicator::showText(ICore::dialogParent(), Tr::tr("%n occurrences replaced.", nullptr, items.size()), FadingIndicator::SmallText); - DocumentManager::notifyFilesChangedInternally(files); SearchResultWindow::instance()->hide(); } } diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index 1398d55bcaa..e49d6ff75fc 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -355,9 +355,9 @@ bool RefactoringFile::apply() QString error; // suppress "file has changed" warnings if the file is open in a read-only editor Core::FileChangeBlocker block(m_filePath); - if (!m_textFileFormat.writeFile(m_filePath, - doc->toPlainText(), - &error)) { + if (m_textFileFormat.writeFile(m_filePath, doc->toPlainText(), &error)) { + Core::DocumentManager::notifyFilesChangedInternally({m_filePath}); + } else { qWarning() << "Could not apply changes to" << m_filePath << ". Error: " << error; result = false;