aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangformat/clangformatbaseindenter.h
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2019-02-13 14:17:21 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2019-02-19 07:33:13 +0000
commit9bcc871ece3e23e9f67264c45a35108f00260294 (patch)
tree928984eaa18bcb73915e7272fa91b15d94a0eaa0 /src/plugins/clangformat/clangformatbaseindenter.h
parent660cd8da1968c51fd854e1763ce76ef833aabc9c (diff)
ClangFormat: Format multiple text ranges at once
'reformat' function in LibFormat accepts mutilple ranges. Let's provide the ranges for the same file together when formatting on save and formatting after fix-its. Change-Id: I27789da83a1efc27beb57acf238508a191562bb9 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/clangformat/clangformatbaseindenter.h')
-rw-r--r--src/plugins/clangformat/clangformatbaseindenter.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/clangformat/clangformatbaseindenter.h b/src/plugins/clangformat/clangformatbaseindenter.h
index 2017f8ba646..d79c1393515 100644
--- a/src/plugins/clangformat/clangformatbaseindenter.h
+++ b/src/plugins/clangformat/clangformatbaseindenter.h
@@ -53,9 +53,8 @@ public:
void formatOrIndent(const QTextCursor &cursor,
const TextEditor::TabSettings &tabSettings,
int cursorPositionInEditor = -1) override;
- TextEditor::Replacements format(const QTextCursor &cursor,
- const TextEditor::TabSettings &tabSettings,
- int cursorPositionInEditor = -1) override;
+ TextEditor::Replacements format(
+ const TextEditor::RangesInLines &rangesInLines = TextEditor::RangesInLines()) override;
void indentBlock(const QTextBlock &block,
const QChar &typedChar,
@@ -75,7 +74,6 @@ protected:
virtual int lastSaveRevision() const { return 0; }
private:
- TextEditor::Replacements format(const QTextCursor &cursor, int cursorPositionInEditor);
void indent(const QTextCursor &cursor, const QChar &typedChar, int cursorPositionInEditor);
void indentBlock(const QTextBlock &block, const QChar &typedChar, int cursorPositionInEditor);
int indentFor(const QTextBlock &block, int cursorPositionInEditor);