From ca84a51f867988cc4a6b3f4058ab6dc9f9badf84 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Wed, 29 Aug 2018 15:58:13 +0200 Subject: Clang: Use clang-format for indentation This is the new experimental plugin based on LibFormat. It replaces the default indenter for CppEditorDocument and applies clang-format after the CR or the set of 'electric' characters. Uses the global .clang-format kept in QtC settings or the one for current project. Both can be configured. For indentation some style modifications and code manipulations are done to prevent line shrinking when it's not expected. Manual indentation uses unmodified style from .clang-format file. Change-Id: I6279b805e418e1804b553efa615f5c843f395a58 Reviewed-by: Marco Bubke --- src/plugins/cpptools/cppmodelmanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cppmodelmanager.cpp') diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index f32e08df71..9303d66338 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -39,6 +39,7 @@ #include "cpplocatordata.h" #include "cpplocatorfilter.h" #include "cppmodelmanagersupportinternal.h" +#include "cppqtstyleindenter.h" #include "cpprefactoringchanges.h" #include "cpprefactoringengine.h" #include "cppsourceprocessor.h" @@ -61,6 +62,7 @@ #include #include #include +#include #include #include @@ -507,7 +509,9 @@ void CppModelManager::initializeBuiltinModelManagerSupport() } CppModelManager::CppModelManager() - : CppModelManagerBase(nullptr), d(new CppModelManagerPrivate) + : CppModelManagerBase(nullptr) + , createCppIndenter([]() { return new CppQtStyleIndenter; }) + , d(new CppModelManagerPrivate) { d->m_indexingSupporter = 0; d->m_enableGC = true; -- cgit v1.2.1