From df26841798ab2f2c88ea9130bea31c696f02423f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 11 Dec 2024 11:18:21 +0100 Subject: [PATCH] CppEditor: Deprecate "assign to local" quickfix ... in favor of clangd's "Extract Variable" tweak. As of https://github.com/llvm/llvm-project/pull/112525, this functionality should be fully covered by clangd. Task-number: QTCREATORBUG-9363 Task-number: QTCREATORBUG-9578 Change-Id: I00ce996ef37b26152d93ed91fa5d1ea69e619618 Reviewed-by: Christian Stenger --- src/plugins/cppeditor/quickfixes/assigntolocalvariable.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/quickfixes/assigntolocalvariable.cpp b/src/plugins/cppeditor/quickfixes/assigntolocalvariable.cpp index ae63681dc26..c3bc3e85daf 100644 --- a/src/plugins/cppeditor/quickfixes/assigntolocalvariable.cpp +++ b/src/plugins/cppeditor/quickfixes/assigntolocalvariable.cpp @@ -123,8 +123,13 @@ private: //! Assigns the return value of a function call or a new expression to a local variable class AssignToLocalVariable : public CppQuickFixFactory { -#ifdef WITH_TESTS public: + AssignToLocalVariable() + { + setClangdReplacement({20}); + } + +#ifdef WITH_TESTS static QObject *createTest(); #endif