forked from qt-creator/qt-creator
Clang: Significantly improve ClangFormat plugin usability
What's new: 1. New LibFormat option is used to prevent lines shrink, which allows to drop most of tricks used before for that purpose. 2. Cached UTF-8 source code is used to improve performance 3. Improved error handling. 4. Slightly improved UI. Change-Id: I4605200fa103167369a40650b2e1ad2c61e8133b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
#include <projectexplorer/projectpanelfactory.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <clang/Format/Format.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QMainWindow>
|
||||
@@ -56,7 +58,6 @@
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace ClangFormat {
|
||||
namespace Internal {
|
||||
|
||||
class ClangFormatOptionsPage : public Core::IOptionsPage
|
||||
{
|
||||
@@ -98,7 +99,7 @@ bool ClangFormatPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
{
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(errorString);
|
||||
|
||||
#ifdef KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED
|
||||
m_optionsPage = std::make_unique<ClangFormatOptionsPage>();
|
||||
|
||||
auto panelFactory = new ProjectPanelFactory();
|
||||
@@ -112,9 +113,8 @@ bool ClangFormatPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
CppTools::CppModelManager::instance()->setCppIndenterCreator([]() {
|
||||
return new ClangFormatIndenter();
|
||||
});
|
||||
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangFormat
|
||||
|
||||
Reference in New Issue
Block a user