Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmllshelputils_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQMLLSHELPUTILS_P_H
6#define QQMLLSHELPUTILS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQmlLS/private/qqmllshelpplugininterface_p.h>
20#include <QtQmlLS/private/qqmllsutils_p.h>
21#include <QtQmlDom/private/qqmldomtop_p.h>
22#include <QtQmlLS/private/qdochtmlparser_p.h>
23#include <QtLanguageServer/private/qlanguageserverspectypes_p.h>
24
25#include <vector>
26
27QT_BEGIN_NAMESPACE
28
29class HelpManager final
30{
31public:
32 HelpManager();
33 void setDocumentationRootPath(const QString &path);
34 [[nodiscard]] QString documentationRootPath() const;
35 [[nodiscard]] std::optional<QByteArray> documentationForItem(
36 const QQmlJS::Dom::DomItem &file, QLspSpecification::Position position);
37
38private:
39 [[nodiscard]] std::optional<QByteArray> extractDocumentationForIdentifiers(const QQmlJS::Dom::DomItem &item,
40 QQmlLSUtils::ExpressionType expr) const;
41 [[nodiscard]] std::optional<QByteArray> extractDocumentationForDomElements(
42 const QQmlJS::Dom::DomItem &item) const;
43 [[nodiscard]] std::optional<QByteArray> extractDocumentation(
44 const QQmlJS::Dom::DomItem &item) const;
45 [[nodiscard]] std::optional<QByteArray> tryExtract(ExtractDocumentation &extractor,
46 const std::vector<QQmlLSHelpProviderBase::DocumentLink> &links,
47 const QString &name) const;
48 [[nodiscard]] std::vector<QQmlLSHelpProviderBase::DocumentLink>
49 collectDocumentationLinks(const QQmlJS::Dom::DomItem &item, const QQmlJSScope::ConstPtr &scope,
50 const QString &name) const;
51 void registerDocumentations(const QStringList &docs) const;
52
53 mutable QMutex m_mutex;
54 std::unique_ptr<QQmlLSHelpProviderBase> m_helpPlugin;
55 QString m_docRootPath;
56 QHash<QString, QString> m_cppTypesToQmlTypes;
57};
58
59QT_END_NAMESPACE
60
61#endif // QQMLLSHELPUTILS_P_H
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
static QStringList documentationFiles(const QString &qtInstallationPath)
static QByteArray documentationForImports(const DomItem &item)