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:
@@ -27,27 +27,26 @@
|
||||
|
||||
#include "qmljstools_global.h"
|
||||
|
||||
#include <texteditor/indenter.h>
|
||||
#include <texteditor/textindenter.h>
|
||||
|
||||
namespace QmlJSEditor {
|
||||
namespace Internal {
|
||||
|
||||
class QMLJSTOOLS_EXPORT Indenter : public TextEditor::Indenter
|
||||
class QMLJSTOOLS_EXPORT Indenter : public TextEditor::TextIndenter
|
||||
{
|
||||
public:
|
||||
Indenter();
|
||||
explicit Indenter(QTextDocument *doc);
|
||||
~Indenter() override;
|
||||
|
||||
bool isElectricCharacter(const QChar &ch) const override;
|
||||
void indentBlock(QTextDocument *doc,
|
||||
const QTextBlock &block,
|
||||
void indentBlock(const QTextBlock &block,
|
||||
const QChar &typedChar,
|
||||
const TextEditor::TabSettings &tabSettings) override;
|
||||
void invalidateCache(QTextDocument *doc) override;
|
||||
void invalidateCache() override;
|
||||
|
||||
int indentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings) override;
|
||||
TextEditor::IndentationForBlock indentationForBlocks(const QVector<QTextBlock> &blocks,
|
||||
const TextEditor::TabSettings &tabSettings) override;
|
||||
TextEditor::IndentationForBlock indentationForBlocks(
|
||||
const QVector<QTextBlock> &blocks, const TextEditor::TabSettings &tabSettings) override;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
||||
Reference in New Issue
Block a user