diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2023-02-07 16:35:40 +0100 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2023-02-24 12:39:54 +0100 |
commit | c6e01fd2a3e72c8cee784e8b018e03c9233b9a68 (patch) | |
tree | 63315f60289de59f90b9573236413ab223d071c9 /src/qmlls/qtextdocument.cpp | |
parent | a09ea6b3d6265a98c17e190db007fecfbd76f317 (diff) |
qmlls: start implementing go-to type definition
A lot of the code used in the qml completion module can be reused for
other modules, e.g. for the go-to type definition.
Create two templated classes called BaseRequest<Params, Response> and
QQmlBaseModule<Request> to extract most of the reusable (boiler)code.
Those are not intended to be used as is, but instead should be
subclassed by a non-template version that fills in the specific types
(because each language server functionality has its own types for the
requests, the request parameters and the request response object that
all need to be handled in the same way in the boilercode).
BaseRequest encapsulate a request (e.g. a CompletionRequest) with its
parameter and response type (every Request type has its own parameter
and response type and therefore they are provided as template
arguments).
Most of the code extracted from the qml completion module is dependent
on the specific Request type, and therefore has been moved into the
QQmlBaseModule helper class. In the class hierarchy, it lies between
QmlCompletionSupport and the QLanguageServerModule (previously,
QmlCompletionSupport was directly inheriting from
QLanguageServerModule).
This allows to reduce drastically the boilercode used in
QmlCompletionSupport and the new QmlGoToTypeDefinitionSupport.
QmlGoToTypeDefinitionSupport adds support for "TypeDefinitionRequests"
and allows retrieving the type definition of an object (as in "go to
the qml file that is called like this object").
Add tests to tst_qmlls_modules that spawns and sends type definition
requests to a qmlls server and checks the received answers.
Also, fix the QmlLSPrivate headers to have a library license instead of
the tool license they had before.
Fixes: QTBUG-110309
Change-Id: Ia6a14978e103440b472b651776a7feec0786cee1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlls/qtextdocument.cpp')
-rw-r--r-- | src/qmlls/qtextdocument.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmlls/qtextdocument.cpp b/src/qmlls/qtextdocument.cpp index bff8c32f9a..826deddbb5 100644 --- a/src/qmlls/qtextdocument.cpp +++ b/src/qmlls/qtextdocument.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qtextdocument_p.h" #include "qtextblock_p.h" |