From 840263eb9a7687f2c0ecd9b0503d355fad5bac5e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 17 May 2022 18:00:04 +0200 Subject: [PATCH] CppEditor: Switch off "extract function" quickfix with clangd There is a clangd tweak that does the same, but better. Fixes: QTCREATORBUG-13240 Fixes: QTCREATORBUG-18607 Change-Id: I59822c725ccb38d995fd8ac03861b1931b81f74c Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: David Schulz --- src/plugins/cppeditor/cppquickfixes.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 7f1f7a7a79d..3d2469fd95a 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -5225,7 +5225,11 @@ ExtractFunction::ExtractFunction(FunctionNameGetter functionNameGetter) void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOperations &result) { - CppRefactoringFilePtr file = interface.currentFile(); + const CppRefactoringFilePtr file = interface.currentFile(); + if (CppModelManager::usesClangd(file->editor()->textDocument()) + && file->cppDocument()->languageFeatures().cxxEnabled) { + return; + } QTextCursor cursor = file->cursor(); if (!cursor.hasSelection())