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
qqmllintsuggestions_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QMLLINTSUGGESTIONS_P_H
6#define QMLLINTSUGGESTIONS_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 <private/qlanguageserver_p.h>
20#include <private/qqmlcodemodelmanager_p.h>
21
22#include <chrono>
23#include <optional>
24
25QT_BEGIN_NAMESPACE
26namespace QmlLsp {
28{
29 std::optional<int> version;
30 std::optional<std::chrono::steady_clock::time_point> invalidUpdatesSince;
31};
32
34{
36public:
38
39public Q_SLOTS:
41
42private:
43 struct VersionedDocument
44 {
45 std::optional<int> version;
46 QQmlJS::Dom::DomItem item;
47 };
48 struct TryAgainLater
49 {
50 std::chrono::milliseconds time;
51 };
52 struct NoDocumentAvailable
53 {
54 };
55
57
58 VersionToDiagnose chooseVersionToDiagnose(const QByteArray &url, UpdatePolicy policy);
59 VersionToDiagnose chooseVersionToDiagnoseHelper(const QByteArray &url, UpdatePolicy policy);
60 void diagnoseHelper(const QByteArray &uri, const VersionedDocument &document);
61
62 QMutex m_mutex;
63 QHash<QByteArray, LastLintUpdate> m_lastUpdate;
64 QLanguageServer *m_server;
65 QmlLsp::QQmlCodeModelManager *m_codeModelManager;
66};
67} // namespace QmlLsp
68QT_END_NAMESPACE
69#endif // QMLLINTSUGGESTIONS_P_H
Combined button and popup list for selecting options.
static Diagnostic messageToDiagnostic_helper(AdvanceFunc advancePositionPastLocation, std::optional< int > version, const Message &message)
static Diagnostic createMissingBuildDirDiagnostic()
static bool isSnapshotNew(std::optional< int > snapshotVersion, std::optional< int > processedVersion, QmlLsp::UpdatePolicy policy)
static void advancePositionPastLocation_helper(const QString &fileContents, const QQmlJS::SourceLocation &location, Position &position)
QJsonArray suggestionToJson(AdvanceFunc advancePositionPastLocation, const Message &message)
static DiagnosticSeverity severityFromMsgType(QtMsgType t)
std::optional< std::chrono::steady_clock::time_point > invalidUpdatesSince
std::optional< int > version