| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | |
| 4 | #ifndef QMLCODEMARKER_H |
| 5 | #define QMLCODEMARKER_H |
| 6 | |
| 7 | #include "cppcodemarker.h" |
| 8 | |
| 9 | #include <private/qqmljsastfwd_p.h> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QmlCodeMarker : public CppCodeMarker |
| 14 | { |
| 15 | public: |
| 16 | QmlCodeMarker() = default; |
| 17 | ~QmlCodeMarker() override = default; |
| 18 | |
| 19 | bool recognizeCode(const QString &code) override; |
| 20 | bool recognizeExtension(const QString &ext) override; |
| 21 | bool recognizeLanguage(const QString &language) override; |
| 22 | [[nodiscard]] Atom::AtomType atomType() const override; |
| 23 | QString markedUpCode(const QString &code, const Node *relative, |
| 24 | const Location &location) override; |
| 25 | |
| 26 | QString markedUpName(const Node *node) override; |
| 27 | |
| 28 | /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */ |
| 29 | QList<QQmlJS::SourceLocation> (QString &script); |
| 30 | |
| 31 | private: |
| 32 | QString addMarkUp(const QString &code, const Node *relative, const Location &location); |
| 33 | }; |
| 34 | |
| 35 | QT_END_NAMESPACE |
| 36 | |
| 37 | #endif |
| 38 | |