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 QLANGUAGESERVER_P_P_H
5#define QLANGUAGESERVER_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qlanguageserver_p.h"
19#include <QtLanguageServer/private/qlanguageserverprotocol_p.h>
20#include <QtCore/QMutex>
21#include <QtCore/QHash>
22#include <QtCore/private/qobject_p.h>
23#include <QtLanguageServer/private/qlspnotifysignals_p.h>
24
25#include <memory>
26
27QT_BEGIN_NAMESPACE
28
29class QRequestInProgress
30{
31public:
32 bool canceled = false;
33};
34
35class QLanguageServerPrivate : public QObjectPrivate
36{
37public:
38 QLanguageServerPrivate(const QJsonRpcTransport::DataHandler &h);
39 mutable QMutex mutex;
40 // mutex gated, monotonically increasing
41 QLanguageServer::RunStatus runStatus = QLanguageServer::RunStatus::NotSetup;
42 QHash<QJsonValue, QRequestInProgress> requestsInProgress; // mutex gated
43 bool clientInitialized = false; // mutex gated
44 QLspSpecification::InitializeParams clientInfo; // immutable after runStatus > DidInitialize
45 QLspSpecification::InitializeResult serverInfo; // immutable after runStatus > DidInitialize
46 QLspSpecification::Responses::ShutdownResponseType shutdownResponse;
47 QHash<QString, QLanguageServerModule *> modules;
48 QLanguageServerProtocol protocol;
49 QLspNotifySignals notifySignals;
50};
51
52QT_END_NAMESPACE
53#endif // QLANGUAGESERVER_P_P_H
54

source code of qtdeclarative/src/qmlls/qlanguageserver_p_p.h