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 | |
4 | #ifndef QQMLLANGUAGESERVER_P_H |
5 | #define QQMLLANGUAGESERVER_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 "qqmlcodemodel_p.h" |
20 | #include "qqmlfindusagessupport_p.h" |
21 | #include "qtextsynchronization_p.h" |
22 | #include "qqmllintsuggestions_p.h" |
23 | #include "qworkspace_p.h" |
24 | #include "qqmlcompletionsupport_p.h" |
25 | #include "qqmlgototypedefinitionsupport_p.h" |
26 | #include "qqmlformatting_p.h" |
27 | #include "qqmlrangeformatting_p.h" |
28 | #include "qqmlgotodefinitionsupport_p.h" |
29 | #include "qqmlrenamesymbolsupport_p.h" |
30 | #include "qqmlhover_p.h" |
31 | #include "qqmlhighlightsupport_p.h" |
32 | |
33 | QT_BEGIN_NAMESPACE |
34 | |
35 | class QQmlToolingSettings; |
36 | |
37 | namespace QmlLsp { |
38 | |
39 | class QQmlLanguageServer : public QLanguageServerModule |
40 | { |
41 | Q_OBJECT |
42 | public: |
43 | QQmlLanguageServer(std::function<void(const QByteArray &)> sendData, |
44 | QQmlToolingSettings *settings = nullptr); |
45 | |
46 | QString name() const final; |
47 | void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) final; |
48 | void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, |
49 | QLspSpecification::InitializeResult &serverInfo) final; |
50 | |
51 | int returnValue() const; |
52 | |
53 | QQmlCodeModel *codeModel(); |
54 | QLanguageServer *server(); |
55 | TextSynchronization *textSynchronization(); |
56 | QmlLintSuggestions *lint(); |
57 | WorkspaceHandlers *worspace(); |
58 | |
59 | public Q_SLOTS: |
60 | void exit(); |
61 | void errorExit(); |
62 | |
63 | private: |
64 | QQmlCodeModel m_codeModel; |
65 | QLanguageServer m_server; |
66 | TextSynchronization m_textSynchronization; |
67 | QmlLintSuggestions m_lint; |
68 | WorkspaceHandlers m_workspace; |
69 | QmlCompletionSupport m_completionSupport; |
70 | QmlGoToTypeDefinitionSupport m_navigationSupport; |
71 | QmlGoToDefinitionSupport m_definitionSupport; |
72 | QQmlFindUsagesSupport m_referencesSupport; |
73 | QQmlDocumentFormatting m_documentFormatting; |
74 | QQmlRenameSymbolSupport m_renameSupport; |
75 | QQmlRangeFormatting m_rangeFormatting; |
76 | QQmlHover m_hover; |
77 | QQmlHighlightSupport m_highlightSupport; |
78 | int m_returnValue = 1; |
79 | }; |
80 | |
81 | } // namespace QmlLsp |
82 | QT_END_NAMESPACE |
83 | #endif // QQMLLANGUAGESERVER_P_H |
84 | |