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:
Ivan Donchevskii
2018-10-11 14:11:43 +02:00
parent 6f73b3b175
commit cafd5ced1a
13 changed files with 396 additions and 339 deletions

View File

@@ -28,7 +28,6 @@
#include <texteditor/indenter.h>
namespace ClangFormat {
namespace Internal {
class ClangFormatIndenter final : public TextEditor::Indenter
{
@@ -42,9 +41,9 @@ public:
const QTextCursor &cursor,
const TextEditor::TabSettings &tabSettings) override;
void indentBlock(QTextDocument *doc,
const QTextBlock &block,
const QChar &typedChar,
const TextEditor::TabSettings &tabSettings) override;
const QTextBlock &block,
const QChar &typedChar,
const TextEditor::TabSettings &tabSettings) override;
int indentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings) override;
bool isElectricCharacter(const QChar &ch) const override;
@@ -53,5 +52,4 @@ public:
TextEditor::TabSettings tabSettings() const override;
};
} // namespace Internal
} // namespace ClangFormat