Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
25
QT_BEGIN_NAMESPACE
26
namespace
QmlLsp
{
27
struct
LastLintUpdate
28
{
29
std
::optional<
int
>
version
;
30
std
::optional<
std
::chrono::steady_clock::time_point>
invalidUpdatesSince
;
31
};
32
33
class
QmlLintSuggestions
:
public
QObject
34
{
35
Q_OBJECT
36
public
:
37
QmlLintSuggestions
(
QLanguageServer
*
server
,
QmlLsp
::
QQmlCodeModelManager
*
codeModelManager
);
38
39
public
Q_SLOTS
:
40
void
diagnose
(
const
QByteArray
&
uri
,
UpdatePolicy
policy
);
41
42
private
:
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
56
using
VersionToDiagnose
=
std
::
variant
<
VersionedDocument
,
TryAgainLater
,
NoDocumentAvailable
>;
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
68
QT_END_NAMESPACE
69
#
endif
// QMLLINTSUGGESTIONS_P_H
QmlLsp::QmlLintSuggestions
Definition
qqmllintsuggestions_p.h:34
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QmlLsp
Definition
qmllsmain.cpp:50
QmlLsp::messageToDiagnostic_helper
static Diagnostic messageToDiagnostic_helper(AdvanceFunc advancePositionPastLocation, std::optional< int > version, const Message &message)
Definition
qqmllintsuggestions.cpp:146
QmlLsp::createMissingBuildDirDiagnostic
static Diagnostic createMissingBuildDirDiagnostic()
Definition
qqmllintsuggestions.cpp:76
QmlLsp::isSnapshotNew
static bool isSnapshotNew(std::optional< int > snapshotVersion, std::optional< int > processedVersion, QmlLsp::UpdatePolicy policy)
Definition
qqmllintsuggestions.cpp:186
QmlLsp::advancePositionPastLocation_helper
static void advancePositionPastLocation_helper(const QString &fileContents, const QQmlJS::SourceLocation &location, Position &position)
Definition
qqmllintsuggestions.cpp:56
QmlLsp::suggestionToJson
QJsonArray suggestionToJson(AdvanceFunc advancePositionPastLocation, const Message &message)
Definition
qqmllintsuggestions.cpp:96
QmlLsp::severityFromMsgType
static DiagnosticSeverity severityFromMsgType(QtMsgType t)
Definition
qqmllintsuggestions.cpp:32
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
QmlLsp::LastLintUpdate
Definition
qqmllintsuggestions_p.h:28
QmlLsp::LastLintUpdate::invalidUpdatesSince
std::optional< std::chrono::steady_clock::time_point > invalidUpdatesSince
Definition
qqmllintsuggestions_p.h:30
QmlLsp::LastLintUpdate::version
std::optional< int > version
Definition
qqmllintsuggestions_p.h:29
qtdeclarative
src
qmlls
qqmllintsuggestions_p.h
Generated on
for Qt by
1.18.0