forked from qt-creator/qt-creator
ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks were required to make ClangFormatIndenter available. First simple unit-test proofs it builds and runs. Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -56,8 +56,8 @@ public:
|
||||
const TextEditor::TabSettings &tabSettings =
|
||||
ProjectExplorer::actualTabSettings(fileName, textDocument);
|
||||
|
||||
CppQtStyleIndenter indenter;
|
||||
indenter.indent(selection.document(), selection, QChar::Null, tabSettings);
|
||||
CppQtStyleIndenter indenter(selection.document());
|
||||
indenter.indent(selection, QChar::Null, tabSettings);
|
||||
}
|
||||
|
||||
void reindentSelection(const QTextCursor &selection,
|
||||
@@ -67,8 +67,9 @@ public:
|
||||
const TextEditor::TabSettings &tabSettings =
|
||||
ProjectExplorer::actualTabSettings(fileName, textDocument);
|
||||
|
||||
CppQtStyleIndenter indenter;
|
||||
indenter.reindent(selection.document(), selection, tabSettings);
|
||||
CppQtStyleIndenter indenter(selection.document());
|
||||
indenter.reindent(selection,
|
||||
tabSettings);
|
||||
}
|
||||
|
||||
void fileChanged(const QString &fileName) override
|
||||
|
||||
Reference in New Issue
Block a user