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 b88b73d9c1, clang formatting should
work without our custom patch, so there is no need to warn against that
either.

Change-Id: I5336857c6e27d9162084c2dacf187acb0015dc6a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2022-12-15 16:38:00 +01:00
parent c0a692a96d
commit 2e6437b8fe
2 changed files with 0 additions and 20 deletions

View File

@@ -2,7 +2,6 @@
\"Name\" : \"ClangFormat\", \"Name\" : \"ClangFormat\",
\"Version\" : \"$$QTCREATOR_VERSION\", \"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"DisabledByDefault\" : true,
\"Vendor\" : \"The Qt Company Ltd\", \"Vendor\" : \"The Qt Company Ltd\",
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
\"License\" : [ \"Commercial Usage\", \"License\" : [ \"Commercial Usage\",

View File

@@ -127,25 +127,6 @@ bool ClangFormatPlugin::initialize(const QStringList &arguments, QString *errorS
openClangFormatConfigAction->setData(doc->filePath().toVariant()); 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; return true;
} }