summaryrefslogtreecommitdiffstats
path: root/src/qdoc/qmlvisitor.h
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2023-04-11 14:38:38 +0200
committerLuca Di Sera <luca.disera@qt.io>2023-04-12 15:06:56 +0200
commit846c860b89ee5fbef4f1db583bd951f8a33e196a (patch)
treef29b0f8ae9c1ab4d796e11e7b72cc56347e8a5e5 /src/qdoc/qmlvisitor.h
parent2ba87cd00e6527dbd64f5884f29081bd535605bb (diff)
QDoc: Move QDoc source files under a further "qdoc" directory
QDoc development under the "qttools" repository is currently performed under the "src/qdoc" directory, which contains all source files and directories relevant to QDoc as direct children. Due to a slow restructuring of how QDoc works, what its dependencies are and certain possible architectural changes, the infrastructure that is expected to be required for the development of QDoc might increase. Some of that infrastructure, which might require some custom effort, is expected to be developed as "independent" "library-like" sub-projects, which QDoc depends on. Albeit developed "independently", such infrastructure would be developed specifically for QDoc and thus should live "adjacent" to it. To allow such a structure a new "qdoc" directory was added under the "src/qdoc" directory. All source files and directory that were previously children of the "src/qdoc" directory were moved under the new "qdoc" directory. This preserves the space for QDoc-related elements and the relative project structure while allowing some space for "adjacent" projects that are intended for QDoc specifically. To support the change, a new "CMakeLists.txt" file was introduced under "src/qdoc", which dispatches to the "CMakeLists.txt" file in the new "src/qdoc/qdoc" directory. QDoc is only built when certain dependencies are found. This is supported through the use of Qt features at the CMake level. The "CMakeLists.txt" file in "src", thus dispatched to the "src/qdoc" directory only when the required features were found. As "independent", "library-like", entities might not have the same requirements as QDoc, the "CMakeLists.txt" file in "src" was modified to always dispatch to the "src/qdoc" directory while the features-check was moved to the new "CMakeLists.txt" files in "src/qdoc", so as to allow non-QDoc but QDoc-specific project to have an independent configuration for building. Certain test projects in "test/auto/qdoc/" depends on QDoc-specific source-files to generate their CMake targets. Those dependencies were generally specified as relative paths. The additional level in the directory structure invalidated the paths and, hence, the relevant "CMakeLists.txt" files for those projects were modified to correctly refer to the new directory structure. Change-Id: I50c7106614428753544eaba5091e1e44d48fd31d Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/qmlvisitor.h')
-rw-r--r--src/qdoc/qmlvisitor.h93
1 files changed, 0 insertions, 93 deletions
diff --git a/src/qdoc/qmlvisitor.h b/src/qdoc/qmlvisitor.h
deleted file mode 100644
index 9482c8bbf..000000000
--- a/src/qdoc/qmlvisitor.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#ifndef QMLVISITOR_H
-#define QMLVISITOR_H
-
-#include "node.h"
-#include "qmltypenode.h"
-
-#include <QtCore/qstring.h>
-
-#include <private/qqmljsastvisitor_p.h>
-#include <private/qqmljsengine_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Aggregate;
-
-struct QmlPropArgs
-{
- QString m_type {};
- QString m_module {};
- QString m_component {};
- QString m_name;
-
- void clear()
- {
- m_type.clear();
- m_module.clear();
- m_component.clear();
- m_name.clear();
- }
-};
-
-class QmlDocVisitor : public QQmlJS::AST::Visitor
-{
-public:
- QmlDocVisitor(const QString &filePath, const QString &code, QQmlJS::Engine *engine,
- const QSet<QString> &commands, const QSet<QString> &topics);
- ~QmlDocVisitor() override = default;
-
- bool visit(QQmlJS::AST::UiImport *import) override;
- void endVisit(QQmlJS::AST::UiImport *definition) override;
-
- bool visit(QQmlJS::AST::UiObjectDefinition *definition) override;
- void endVisit(QQmlJS::AST::UiObjectDefinition *definition) override;
-
- bool visit(QQmlJS::AST::UiPublicMember *member) override;
- void endVisit(QQmlJS::AST::UiPublicMember *definition) override;
-
- bool visit(QQmlJS::AST::UiObjectBinding *) override;
- void endVisit(QQmlJS::AST::UiObjectBinding *) override;
- void endVisit(QQmlJS::AST::UiArrayBinding *) override;
- bool visit(QQmlJS::AST::UiArrayBinding *) override;
-
- bool visit(QQmlJS::AST::IdentifierPropertyName *idproperty) override;
-
- bool visit(QQmlJS::AST::FunctionDeclaration *) override;
- void endVisit(QQmlJS::AST::FunctionDeclaration *) override;
-
- bool visit(QQmlJS::AST::UiScriptBinding *) override;
- void endVisit(QQmlJS::AST::UiScriptBinding *) override;
-
- bool visit(QQmlJS::AST::UiQualifiedId *) override;
- void endVisit(QQmlJS::AST::UiQualifiedId *) override;
-
- void throwRecursionDepthError() final;
- [[nodiscard]] bool hasError() const;
-
-private:
- QString getFullyQualifiedId(QQmlJS::AST::UiQualifiedId *id);
- [[nodiscard]] QQmlJS::SourceLocation precedingComment(quint32 offset) const;
- bool applyDocumentation(QQmlJS::SourceLocation location, Node *node);
- void applyMetacommands(QQmlJS::SourceLocation location, Node *node, Doc &doc);
- bool splitQmlPropertyArg(const Doc &doc, const QString &arg, QmlPropArgs &qpa);
-
- QQmlJS::Engine *m_engine { nullptr };
- quint32 m_lastEndOffset {};
- quint32 m_nestingLevel {};
- QString m_filePath {};
- QString m_name {};
- QString m_document {};
- ImportList m_importList {};
- QSet<QString> m_commands {};
- QSet<QString> m_topics {};
- QSet<quint32> m_usedComments {};
- Aggregate *m_current { nullptr };
- bool hasRecursionDepthError { false };
-};
-
-QT_END_NAMESPACE
-
-#endif