From 725c36e8d081144bc1834dc8e35a923773beb41c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 16 Aug 2022 10:46:21 +0200 Subject: [PATCH] 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 840263eb9a7687f2c0ecd9b0503d355fad5bac5e. Fixes: QTCREATORBUG-28030 Change-Id: I511eb9a5cc45e3fd5e3cc25898aebb493f1ba3d3 Reviewed-by: David Schulz Reviewed-by: Qt CI Bot Reviewed-by: --- src/plugins/cppeditor/cppquickfixes.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 8469327414d..0f76dd8e53b 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -5243,10 +5243,12 @@ ExtractFunction::ExtractFunction(FunctionNameGetter functionNameGetter) void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOperations &result) { const CppRefactoringFilePtr file = interface.currentFile(); - if (CppModelManager::usesClangd(file->editor()->textDocument()) - && file->cppDocument()->languageFeatures().cxxEnabled) { - return; - } + + // TODO: Fix upstream and uncomment; see QTCREATORBUG-28030. +// if (CppModelManager::usesClangd(file->editor()->textDocument()) +// && file->cppDocument()->languageFeatures().cxxEnabled) { +// return; +// } QTextCursor cursor = file->cursor(); if (!cursor.hasSelection())