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
qqmlcompletionsupport_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 QQMLCOMPLETIONSUPPORT_P_H
6#define QQMLCOMPLETIONSUPPORT_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
21
22#include <QtCore/qmutex.h>
23#include <QtCore/qhash.h>
24#include <QtQmlLS/private/qqmllscompletion_p.h>
25
26QT_BEGIN_NAMESPACE
27struct CompletionRequest
28 : BaseRequest<QLspSpecification::CompletionParams,
29 QLspSpecification::LSPPartialResponse<
30 std::variant<QList<QLspSpecification::CompletionItem>,
31 QLspSpecification::CompletionList, std::nullptr_t>,
32 std::variant<QLspSpecification::CompletionList,
33 QList<QLspSpecification::CompletionItem>>>>
34{
35 QString code;
36
37 bool fillFrom(QmlLsp::OpenDocument doc, const Parameters &params, Response &&response);
38 void sendCompletions(const QList<QLspSpecification::CompletionItem> &completions);
39 QString urlAndPos() const;
40 QList<QLspSpecification::CompletionItem>
41 completions(QmlLsp::OpenDocumentSnapshot &doc, const QQmlLSCompletion &completionEngine) const;
42 QQmlJS::Dom::DomItem patchInvalidFileForParser(const QQmlJS::Dom::DomItem &file,
43 qsizetype position) const;
44};
45
47{
49public:
51 QString name() const override;
52 void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override;
53 void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo,
54 QLspSpecification::InitializeResult &) override;
55 void process(RequestPointerArgument req) override;
56
58};
59QT_END_NAMESPACE
60
61#endif // QMLCOMPLETIONSUPPORT_P_H
Implements a server for the language server protocol.
QString name() const override
void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override
QQmlLSCompletion m_completionEngine
void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &) override
void process(RequestPointerArgument req) override
static bool positionIsFollowedBySpaces(qsizetype position, const QString &code)