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
qqmllanguageserver_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 QQMLLANGUAGESERVER_P_H
6#define QQMLLANGUAGESERVER_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 <private/qqmldocumentsymbolsupport_p.h>
20#include <private/qlanguageserver_p.h>
21#include <private/qqmlcodemodelmanager_p.h>
22#include <private/qqmlfindusagessupport_p.h>
23#include <private/qtextsynchronization_p.h>
24#include <private/qqmllintsuggestions_p.h>
25#include <private/qworkspace_p.h>
26#include <private/qqmlcompletionsupport_p.h>
27#include <private/qqmlgototypedefinitionsupport_p.h>
28#include <private/qqmlformatting_p.h>
29#include <private/qqmlrangeformatting_p.h>
30#include <private/qqmlgotodefinitionsupport_p.h>
31#include <private/qqmlrenamesymbolsupport_p.h>
32#include <private/qqmlhover_p.h>
33#include <private/qqmlhighlightsupport_p.h>
34#include <private/qqmlprogresssupport_p.h>
35
36QT_BEGIN_NAMESPACE
37
38class QQmlToolingSettings;
39
40namespace QmlLsp {
41
43{
45public:
49
50 QString name() const final;
51 void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) final;
52 void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo,
53 QLspSpecification::InitializeResult &serverInfo) final;
54
55 int returnValue() const;
56
62
63public Q_SLOTS:
64 void exit();
65 void errorExit();
66
67private:
68 QQmlCodeModelManager m_codeModelManager;
69 QLanguageServer m_server;
70
71 TextSynchronization m_textSynchronization;
72 WorkspaceHandlers m_workspace;
73
74 // note: the order in which server modules are initialized also defines the order in which
75 // they are run! Most of them connect to m_codeModelManager::updatedSnapshot in
76 // their constructors, see https://doc.qt.io/qt-6/signalsandslots.html#signals.
77 // ==== modules that are directly triggered by the user ====
78 QmlCompletionSupport m_completionSupport;
79 QmlGoToTypeDefinitionSupport m_navigationSupport;
80 QmlGoToDefinitionSupport m_definitionSupport;
81 QQmlFindUsagesSupport m_referencesSupport;
82 QQmlDocumentFormatting m_documentFormatting;
83 QQmlRenameSymbolSupport m_renameSupport;
84 QQmlRangeFormatting m_rangeFormatting;
85 QQmlHover m_hover;
86
87 // ==== Highlighting ====
88 QQmlHighlightSupport m_highlightSupport;
89
90 // ==== modules that are not triggered by the user ====
91 QQmlDocumentSymbolSupport m_documentSymbolSupport;
92 QQmlProgressSupport m_progressSupport;
93
94 // ==== Linting should happen at the end as it potentially can take a longer time ====
95 QmlLintSuggestions m_lint;
96 int m_returnValue = 1;
97};
98
99} // namespace QmlLsp
100QT_END_NAMESPACE
101#endif // QQMLLANGUAGESERVER_P_H
Implements a server for the language server protocol.
Sets up a QmlLanguageServer.
TextSynchronization * textSynchronization()
QQmlCodeModelManager * codeModelManager()
void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &serverInfo) final
void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) final