ClangFormat: Return replacements from 'format' call

We want to have the results of the 'format' call in order to
have understanding what has changed and if the existing offsets
have to be adjusted.

One of the possible use cases is the formatting after fix-its.
If we apply several fix-its in the same file we need to know
after each of them if the further ones are affected and shift them.

Change-Id: I17e8f4dbcf6d36224ab7da9e11035cf3be3d3125
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-11-21 14:54:47 +01:00
parent 7ea23f24fb
commit 89b83aab2a
4 changed files with 148 additions and 131 deletions

View File

@@ -40,9 +40,9 @@ public:
void reindent(QTextDocument *doc,
const QTextCursor &cursor,
const TextEditor::TabSettings &tabSettings) override;
void format(QTextDocument *doc,
const QTextCursor &cursor,
const TextEditor::TabSettings &tabSettings) override;
TextEditor::Replacements format(QTextDocument *doc,
const QTextCursor &cursor,
const TextEditor::TabSettings &tabSettings) override;
void indentBlock(QTextDocument *doc,
const QTextBlock &block,
const QChar &typedChar,