From 4d3bb1c85859be07001a76fad24de457811a7d63 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 7 May 2019 11:28:50 +0200 Subject: [PATCH] ClangFormat: Provide an error message for Clang Format If an patch is not applied to libFormat in Clang we do nothing. It would be better to provide feedback if the plugin is loaded. Change-Id: Iea9900cf7683b521497cc6403638498a9ca5e2e9 Fixes: QTCREATORBUG-22404 Reviewed-by: Leena Miettinen Reviewed-by: Tim Jenssen --- src/plugins/clangformat/clangformatplugin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/clangformat/clangformatplugin.cpp b/src/plugins/clangformat/clangformatplugin.cpp index e82802ab303..49f4fe049f0 100644 --- a/src/plugins/clangformat/clangformatplugin.cpp +++ b/src/plugins/clangformat/clangformatplugin.cpp @@ -152,8 +152,13 @@ bool ClangFormatPlugin::initialize(const QStringList &arguments, QString *errorS openClangFormatConfigAction->setData(doc->filePath().toString()); }); } -#endif return true; +#else + *errorString = "Disabling ClangFormat plugin as it is not built against a suitable version of " + "Clang's libFormat. For more information, see the Qt Creator README at " + "https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md"; + return false; +#endif } } // namespace ClangFormat