2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2010-11-08 16:11:26 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-11-08 16:11:26 +01:00
|
|
|
|
|
|
|
|
#include <texteditor/autocompleter.h>
|
2019-08-08 17:15:16 +02:00
|
|
|
#include <qmljseditor/qmljseditor_global.h>
|
2010-11-08 16:11:26 +01:00
|
|
|
|
|
|
|
|
namespace QmlJSEditor {
|
|
|
|
|
|
2019-08-08 17:15:16 +02:00
|
|
|
class QMLJSEDITOR_EXPORT AutoCompleter : public TextEditor::AutoCompleter
|
2010-11-08 16:11:26 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
AutoCompleter();
|
2016-04-14 09:00:05 +02:00
|
|
|
~AutoCompleter() override;
|
2010-11-08 16:11:26 +01:00
|
|
|
|
2016-04-14 09:00:05 +02:00
|
|
|
bool contextAllowsAutoBrackets(const QTextCursor &cursor,
|
|
|
|
|
const QString &textToInsert = QString()) const override;
|
|
|
|
|
bool contextAllowsAutoQuotes(const QTextCursor &cursor,
|
|
|
|
|
const QString &textToInsert = QString()) const override;
|
|
|
|
|
bool contextAllowsElectricCharacters(const QTextCursor &cursor) const override;
|
|
|
|
|
bool isInComment(const QTextCursor &cursor) const override;
|
|
|
|
|
QString insertMatchingBrace(const QTextCursor &tc,
|
|
|
|
|
const QString &text,
|
|
|
|
|
QChar lookAhead,
|
2016-06-10 15:13:38 +02:00
|
|
|
bool skipChars,
|
2016-04-14 09:00:05 +02:00
|
|
|
int *skippedChars) const override;
|
|
|
|
|
QString insertMatchingQuote(const QTextCursor &tc,
|
|
|
|
|
const QString &text,
|
|
|
|
|
QChar lookAhead,
|
2016-06-10 15:13:38 +02:00
|
|
|
bool skipChars,
|
2016-04-14 09:00:05 +02:00
|
|
|
int *skippedChars) const override;
|
|
|
|
|
QString insertParagraphSeparator(const QTextCursor &tc) const override;
|
2010-11-08 16:11:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // QmlJSEditor
|