6#include <QtLanguageServer/private/qlanguageserverspectypes_p.h>
7#include <QtQmlDom/private/qqmldomexternalitems_p.h>
8#include <QtQmlDom/private/qqmldomtop_p.h>
21 return u
"QmlDefinitionSupport"_s;
25 const QLspSpecification::InitializeParams &,
26 QLspSpecification::InitializeResult &serverCapabilities)
31 serverCapabilities.capabilities.definitionProvider =
true;
35 QLanguageServerProtocol *protocol)
54 QLspSpecification::Location l;
60 qWarning() << u
"Could not obtain the file of the base."_s;
63 const QString qmlCode = fileOfBasePtr->code();
Implements a server for the language server protocol.
void append(parameter_type t)
static std::optional< QQmlLSUtilsLocation > findDefinitionOf(QQmlJS::Dom::DomItem item)
static QLspSpecification::Range qmlLocationToLspLocation(const QString &code, QQmlJS::SourceLocation qmlLocation)
Converts a QQmlJS::SourceLocation to a LSP Range.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QByteArray toEncoded(FormattingOptions options=FullyEncoded) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
void process(RequestPointerArgument request) override
QmlGoToDefinitionSupport(QmlLsp::QQmlCodeModel *codeModel)
void registerHandlers(QLanguageServer *server, QLanguageServerProtocol *protocol) override
QString name() const override
void setupCapabilities(const QLspSpecification::InitializeParams &clientInfo, QLspSpecification::InitializeResult &) override
Combined button and popup list for selecting options.
QNetworkRequest request(url)
std::optional< QList< QQmlLSUtilsItemLocation > > itemsForRequest(const RequestPointer &request)
decltype(auto) getRequestHandler()