CppEditor: Keep offering "Extract Function" after all

As it turns out, there are some bugs in clangd that prevent this
functionality from working in some circumstances.
This effectively reverts 840263eb9a.

Fixes: QTCREATORBUG-28030
Change-Id: I511eb9a5cc45e3fd5e3cc25898aebb493f1ba3d3
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Christian Kandeler
2022-08-16 10:46:21 +02:00
parent 305517f212
commit 725c36e8d0

View File

@@ -5243,10 +5243,12 @@ ExtractFunction::ExtractFunction(FunctionNameGetter functionNameGetter)
void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOperations &result) void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOperations &result)
{ {
const CppRefactoringFilePtr file = interface.currentFile(); const CppRefactoringFilePtr file = interface.currentFile();
if (CppModelManager::usesClangd(file->editor()->textDocument())
&& file->cppDocument()->languageFeatures().cxxEnabled) { // TODO: Fix upstream and uncomment; see QTCREATORBUG-28030.
return; // if (CppModelManager::usesClangd(file->editor()->textDocument())
} // && file->cppDocument()->languageFeatures().cxxEnabled) {
// return;
// }
QTextCursor cursor = file->cursor(); QTextCursor cursor = file->cursor();
if (!cursor.hasSelection()) if (!cursor.hasSelection())