From 2e6437b8fe98765f219a93d1f3493cc47cb50e71 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 15 Dec 2022 16:38:00 +0100 Subject: [PATCH] ClangFormat: Enable plugin by default ... and remove the compile- and run-time warnings. Users can easily opt out of using clang-format via the settings dialog these days (globally and per project), so loading the plugin does no harm. As of b88b73d9c1b9fb4c1da4ab8ad85fbcad05512668, clang formatting should work without our custom patch, so there is no need to warn against that either. Change-Id: I5336857c6e27d9162084c2dacf187acb0015dc6a Reviewed-by: Reviewed-by: Artem Sokolovskii Reviewed-by: Eike Ziller --- src/plugins/clangformat/ClangFormat.json.in | 1 - src/plugins/clangformat/clangformatplugin.cpp | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/src/plugins/clangformat/ClangFormat.json.in b/src/plugins/clangformat/ClangFormat.json.in index f270fea580e..cf952b481ce 100644 --- a/src/plugins/clangformat/ClangFormat.json.in +++ b/src/plugins/clangformat/ClangFormat.json.in @@ -2,7 +2,6 @@ \"Name\" : \"ClangFormat\", \"Version\" : \"$$QTCREATOR_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, \"Vendor\" : \"The Qt Company Ltd\", \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", \"License\" : [ \"Commercial Usage\", diff --git a/src/plugins/clangformat/clangformatplugin.cpp b/src/plugins/clangformat/clangformatplugin.cpp index 10baa28e098..7c3a99f5eec 100644 --- a/src/plugins/clangformat/clangformatplugin.cpp +++ b/src/plugins/clangformat/clangformatplugin.cpp @@ -127,25 +127,6 @@ bool ClangFormatPlugin::initialize(const QStringList &arguments, QString *errorS openClangFormatConfigAction->setData(doc->filePath().toVariant()); }); } -#ifndef KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED -#ifdef _MSC_VER -#pragma message( \ - "ClangFormat: building against unmodified Clang, see README.md for more info") -#else -#warning ClangFormat: building against unmodified Clang, see README.md for more info -#endif - static const Id clangFormatFormatWarningKey = "ClangFormatFormatWarning"; - if (!ICore::infoBar()->canInfoBeAdded(clangFormatFormatWarningKey)) - return true; - InfoBarEntry - info(clangFormatFormatWarningKey, - tr("The ClangFormat plugin has been built against an unmodified Clang. " - "You might experience formatting glitches in certain circumstances. " - "See https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md for more " - "information."), - InfoBarEntry::GlobalSuppression::Enabled); - ICore::infoBar()->addInfo(info); -#endif return true; }