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
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// Qt-Security score:significant reason:default
4
5#ifndef QQMLHIGHLIGHTSUPPORT_P_H
6#define QQMLHIGHLIGHTSUPPORT_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
22
24
25// We don't need these overrides as we register the request handlers in a single
26// module QQmlHighlightSupport. This is an unusual pattern because QQmlBaseModule
27// and QLanguageServerModule abstractions are designed to handle a single module
28// which has a single request handlers. That is not the case for the semanticTokens
29// module which has a one server module but also has three different handlers.
30#define HIDE_UNUSED_OVERRIDES
31 private:
32 QString name() const override
33 {
34 return {};
35 }
36 void setupCapabilities(const QLspSpecification::InitializeParams &,
37 QLspSpecification::InitializeResult &) override
38 {
39 }
40
41using SemanticTokensRequest = BaseRequest<QLspSpecification::SemanticTokensParams,
42 QLspSpecification::Responses::SemanticTokensResponseType>;
43
44using SemanticTokensDeltaRequest =
45 BaseRequest<QLspSpecification::SemanticTokensDeltaParams,
46 QLspSpecification::Responses::SemanticTokensDeltaResponseType>;
47
48using SemanticTokensRangeRequest =
49 BaseRequest<QLspSpecification::SemanticTokensRangeParams,
50 QLspSpecification::Responses::SemanticTokensRangeResponseType>;
51
53{
54public:
56 void process(QQmlBaseModule<SemanticTokensRequest>::RequestPointerArgument req) override;
57 void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override;
58 void setHighlightingMode(HighlightingUtils::HighlightingMode mode) { m_mode = mode; }
61};
62
64{
65public:
67 void process(QQmlBaseModule<SemanticTokensDeltaRequest>::RequestPointerArgument req) override;
68 void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override;
69 void setHighlightingMode(HighlightingUtils::HighlightingMode mode) { m_mode = mode; }
72};
73
75{
76public:
78 void process(QQmlBaseModule<SemanticTokensRangeRequest>::RequestPointerArgument req) override;
79 void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override;
80 void setHighlightingMode(HighlightingUtils::HighlightingMode mode) { m_mode = mode; }
83};
84
86{
87public:
89 QString name() const override;
90 void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override;
91 void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo,
92 QLspSpecification::InitializeResult &) override;
93private:
97};
98
99#undef HIDE_UNUSED_OVERRIDES
100
101QT_END_NAMESPACE
102
103#endif // QQMLHIGHLIGHTSUPPORT_P_H
Implements a server for the language server protocol.
void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override
QString name() const override
QQmlHighlightSupport(QmlLsp::QQmlCodeModelManager *codeModel)
void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &) override
void process(QQmlBaseModule< SemanticTokensDeltaRequest >::RequestPointerArgument req) override
SemanticTokenDeltaHandler(QmlLsp::QQmlCodeModelManager *codeModel)
void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override
HIDE_UNUSED_OVERRIDES HighlightingUtils::HighlightingMode m_mode
void setHighlightingMode(HighlightingUtils::HighlightingMode mode)
void setHighlightingMode(HighlightingUtils::HighlightingMode mode)
void process(QQmlBaseModule< SemanticTokensRequest >::RequestPointerArgument req) override
SemanticTokenFullHandler(QmlLsp::QQmlCodeModelManager *codeModel)
void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override
HIDE_UNUSED_OVERRIDES HighlightingUtils::HighlightingMode m_mode
SemanticTokenRangeHandler(QmlLsp::QQmlCodeModelManager *codeModel)
void setHighlightingMode(HighlightingUtils::HighlightingMode mode)
HIDE_UNUSED_OVERRIDES HighlightingUtils::HighlightingMode m_mode
void process(QQmlBaseModule< SemanticTokensRangeRequest >::RequestPointerArgument req) override
void registerHandlers(QLanguageServer *, QLanguageServerProtocol *) override
void updateResultID(QByteArray &resultID)
QList< QByteArray > extendedTokenTypesList()
QList< QByteArray > defaultTokenModifiersList()
static QList< QByteArray > enumToByteArray()
#define HIDE_UNUSED_OVERRIDES
This class sends a result or an error when going out of scope.