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 | QString markedUpInclude(const QString &include) override; |
28 | |
29 | /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */ |
30 | QList<QQmlJS::SourceLocation> (QString &script); |
31 | |
32 | private: |
33 | QString addMarkUp(const QString &code, const Node *relative, const Location &location); |
34 | }; |
35 | |
36 | QT_END_NAMESPACE |
37 | |
38 | #endif |
39 | |