Debian Codegraph @

LspCpp/include/LibLsp/lsp/textDocument/document_link.h

raw
1 #pragma once
2
3 #include "LibLsp/JsonRpc/RequestInMessage.h"
4 #include "LibLsp/JsonRpc/lsResponseMessage.h"
5 #include "LibLsp/lsp/lsTextDocumentIdentifier.h"
6 #include "LibLsp/lsp/lsRange.h"
7 #include "LibLsp/lsp/lsAny.h"
8
9 namespace TextDocumentDocumentLink
10 {
11
12 struct Params
13 {
14 // The document to provide document links for.
15 lsTextDocumentIdentifier textDocument;
16 MAKE_SWAP_METHOD(Params, textDocument)
17 };
18
19 }; // namespace TextDocumentDocumentLink
20 MAKE_REFLECT_STRUCT(TextDocumentDocumentLink::Params, textDocument);
21
22 // A document link is a range in a text document that links to an internal or
23 // external resource, like another text document or a web site.
24 struct lsDocumentLink
25 {
26 // The range this link applies to.
27 lsRange range;
28 // The uri this link points to. If missing a resolve request is sent later.
29 optional<lsDocumentUri> target;
30
31 optional<lsp::Any> data;
32
33 MAKE_SWAP_METHOD(lsDocumentLink, range, target, data)
34 };
35 MAKE_REFLECT_STRUCT(lsDocumentLink, range, target, data);
36
37 DEFINE_REQUEST_RESPONSE_TYPE(
38 td_links, TextDocumentDocumentLink::Params, std::vector<lsDocumentLink>, "textDocument/documentLink"
39 );
40
41 /**
42 * The document link resolve request is sent from the client to the server to resolve the target of a given document link.
43 */
44 DEFINE_REQUEST_RESPONSE_TYPE(td_linkResolve, lsDocumentLink, lsDocumentLink, "documentLink/resolve");