Commit fca423c5 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

lspclient: add server support for document/typeDefinition

parent 43d53009
......@@ -78,6 +78,7 @@ struct LSPServerCapabilities {
bool definitionProvider = false;
// official extension as of 3.14.0
bool declarationProvider = false;
bool typeDefinitionProvider = false;
bool referencesProvider = false;
bool implementationProvider = false;
bool documentSymbolProvider = false;
......
......@@ -296,6 +296,7 @@ static void from_json(LSPServerCapabilities &caps, const QJsonObject &json)
from_json(caps.signatureHelpProvider, json.value(QStringLiteral("signatureHelpProvider")));
caps.definitionProvider = json.value(QStringLiteral("definitionProvider")).toBool();
caps.declarationProvider = json.value(QStringLiteral("declarationProvider")).toBool();
caps.typeDefinitionProvider = json.value(QStringLiteral("typeDefinitionProvider")).toBool();
caps.referencesProvider = json.value(QStringLiteral("referencesProvider")).toBool();
caps.implementationProvider = json.value(QStringLiteral("implementationProvider")).toBool();
caps.documentSymbolProvider = json.value(QStringLiteral("documentSymbolProvider")).toBool();
......@@ -1152,6 +1153,12 @@ public:
return send(init_request(QStringLiteral("textDocument/declaration"), params), h);
}
RequestHandle documentTypeDefinition(const QUrl &document, const LSPPosition &pos, const GenericReplyHandler &h)
{
auto params = textDocumentPositionParams(document, pos);
return send(init_request(QStringLiteral("textDocument/typeDefinition"), params), h);
}
RequestHandle documentImplementation(const QUrl &document, const LSPPosition &pos, const GenericReplyHandler &h)
{
auto params = textDocumentPositionParams(document, pos);
......@@ -1425,6 +1432,12 @@ LSPClientServer::documentDeclaration(const QUrl &document, const LSPPosition &po
return d->documentDeclaration(document, pos, make_handler(h, context, parseDocumentLocation));
}
LSPClientServer::RequestHandle
LSPClientServer::documentTypeDefinition(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h)
{
return d->documentTypeDefinition(document, pos, make_handler(h, context, parseDocumentLocation));
}
LSPClientServer::RequestHandle
LSPClientServer::documentHover(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentHoverReplyHandler &h)
{
......
......@@ -115,6 +115,7 @@ public:
RequestHandle documentSymbols(const QUrl &document, const QObject *context, const DocumentSymbolsReplyHandler &h, const ErrorReplyHandler &eh = nullptr);
RequestHandle documentDefinition(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h);
RequestHandle documentDeclaration(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h);
RequestHandle documentTypeDefinition(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h);
RequestHandle documentImplementation(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h);
RequestHandle documentHighlight(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentHighlightReplyHandler &h);
RequestHandle documentHover(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentHoverReplyHandler &h);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment