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
qlanguageserver_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 QLANGUAGESERVER_P_H
6#define QLANGUAGESERVER_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 <QtLanguageServer/private/qlanguageserverspec_p.h>
20#include <QtLanguageServer/private/qlanguageserverprotocol_p.h>
21#include <QtLanguageServer/private/qlspnotifysignals_p.h>
22#include <QtCore/qloggingcategory.h>
23
24QT_BEGIN_NAMESPACE
25
26class QLanguageServer;
28Q_DECLARE_LOGGING_CATEGORY(lspServerLog)
29
31{
33public:
35 virtual QString name() const = 0;
36 virtual void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) = 0;
37 virtual void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo,
38 QLspSpecification::InitializeResult &) = 0;
39};
40
42{
43 Q_OBJECT
44 Q_PROPERTY(RunStatus runStatus READ runStatus NOTIFY runStatusChanged)
46public:
60
62 void finishSetup();
63 void registerHandlers(QLanguageServerProtocol *protocol);
64 void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo,
65 QLspSpecification::InitializeResult &serverInfo);
66 void addServerModule(QLanguageServerModule *serverModule);
67 QLanguageServerModule *moduleByName(const QString &n) const;
69
70 // API
71 RunStatus runStatus() const;
72 bool isInitialized() const;
73 bool isRequestCanceled(const QJsonRpc::IdType &id) const;
76
77public Q_SLOTS:
78 void receiveData(const QByteArray &d, bool isEndOfMessage);
82 void shutdown();
83 void exit();
86
87private:
88 void registerMethods(QJsonRpc::TypedRpc &typedRpc);
89 void executeShutdown();
91};
92
93QT_END_NAMESPACE
94
95#endif // QLANGUAGESERVER_P_H
virtual void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &)=0
virtual void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol)=0
QLspSpecification::Responses::ShutdownResponseType shutdownResponse
QHash< QJsonValue, QRequestInProgress > requestsInProgress
QLspSpecification::InitializeParams clientInfo
QLspNotifySignals notifySignals
QLspSpecification::InitializeResult serverInfo
QHash< QString, QLanguageServerModule * > modules
QLanguageServerProtocol protocol
QLanguageServerPrivate(const QJsonRpcTransport::DataHandler &h)
QLanguageServer::RunStatus runStatus
Implements a server for the language server protocol.
void registerHandlers(QLanguageServerProtocol *protocol)
void clientInitialized(QLanguageServer *server)
const QLspSpecification::InitializeParams & clientInfo() const
void lifecycleError()
void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &serverInfo)
bool isRequestCanceled(const QJsonRpc::IdType &id) const
QLspNotifySignals * notifySignals()
const QLspSpecification::InitializeResult & serverInfo() const
void addServerModule(QLanguageServerModule *serverModule)
QLanguageServerModule * moduleByName(const QString &n) const
bool isInitialized() const
RunStatus runStatus() const
void readNextMessage()