Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlhighlightsupport_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
4#ifndef QQMLHIGHLIGHTSUPPORT_P_H
5#define QQMLHIGHLIGHTSUPPORT_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 "qqmlbasemodule_p.h"
20#include "qqmlcodemodel_p.h"
21
23
24// We don't need these overrides as we register the request handlers in a single
25// module QQmlHighlightSupport. This is an unusual pattern because QQmlBaseModule
26// and QLanguageServerModule abstractions are designed to handle a single module
27// which has a single request handlers. That is not the case for the semanticTokens
28// module which has a one server module but also has three different handlers.
29#define HIDE_UNUSED_OVERRIDES \
30 private: \
31 QString name() const override \
32 { \
33 return {}; \
34 } \
35 void setupCapabilities(const QLspSpecification::InitializeParams &, \
36 QLspSpecification::InitializeResult &) override \
37 { \
38 }
39
40using SemanticTokensRequest = BaseRequest<QLspSpecification::SemanticTokensParams,
41 QLspSpecification::Responses::SemanticTokensResponseType>;
42
44 BaseRequest<QLspSpecification::SemanticTokensDeltaParams,
45 QLspSpecification::Responses::SemanticTokensDeltaResponseType>;
46
48 BaseRequest<QLspSpecification::SemanticTokensRangeParams,
49 QLspSpecification::Responses::SemanticTokensRangeResponseType>;
50
51class SemanticTokenFullHandler : public QQmlBaseModule<SemanticTokensRequest>
52{
53public:
56 void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override;
58};
59
60class SemanticTokenDeltaHandler : public QQmlBaseModule<SemanticTokensDeltaRequest>
61{
62public:
65 void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override;
67};
68
69class SemanticTokenRangeHandler : public QQmlBaseModule<SemanticTokensRangeRequest>
70{
71public:
74 void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override;
76};
77
79{
80public:
82 QString name() const override;
83 void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override;
84 void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo,
85 QLspSpecification::InitializeResult &) override;
86private:
90};
91
92#undef HIDE_UNUSED_OVERRIDES
93
95
96#endif // QQMLHIGHLIGHTSUPPORT_P_H
Implements a server for the language server protocol.
void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override
QQmlHighlightSupport(QmlLsp::QQmlCodeModel *codeModel)
QString name() const override
void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &) override
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void process(QQmlBaseModule< SemanticTokensDeltaRequest >::RequestPointerArgument req) override
void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override
SemanticTokenDeltaHandler(QmlLsp::QQmlCodeModel *codeModel)
void process(QQmlBaseModule< SemanticTokensRequest >::RequestPointerArgument req) override
void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override
SemanticTokenFullHandler(QmlLsp::QQmlCodeModel *codeModel)
SemanticTokenRangeHandler(QmlLsp::QQmlCodeModel *codeModel)
void process(QQmlBaseModule< SemanticTokensRangeRequest >::RequestPointerArgument req) override
void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall DBusPendingCall return DBusPendingCall return dbus_int32_t return DBusServer * server
#define HIDE_UNUSED_OVERRIDES
RequestPointer && RequestPointerArgument