| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "LibLsp/JsonRpc/RequestInMessage.h" |
| 4 |
#include "LibLsp/JsonRpc/lsResponseMessage.h" |
| 5 |
|
| 6 |
#include "LibLsp/lsp/lsMarkedString.h" |
| 7 |
#include "LibLsp/lsp/lsTextDocumentPositionParams.h" |
| 8 |
#include "LibLsp/lsp/lsRange.h" |
| 9 |
/** |
| 10 |
* The hover request is sent from the client to the server to request hover |
| 11 |
* information at a given text document position. |
| 12 |
* |
| 13 |
* Registration Options: TextDocumentRegistrationOptions |
| 14 |
*/ |
| 15 |
|
| 16 |
namespace TextDocumentHover |
| 17 |
{ |
| 18 |
typedef optional<std::vector<std::pair<optional<std::string>, optional<lsMarkedString>>>> Left; |
| 19 |
typedef std::pair<Left, optional<MarkupContent>> Either; |
| 20 |
struct Result |
| 21 |
{ |
| 22 |
/** |
| 23 |
* The hover's content as markdown |
| 24 |
*/ |
| 25 |
Either contents; |
| 26 |
|
| 27 |
/** |
| 28 |
* An optional range |
| 29 |
*/ |
| 30 |
optional<lsRange> range; |
| 31 |
|
| 32 |
MAKE_SWAP_METHOD(Result, contents, range) |
| 33 |
}; |
| 34 |
} // namespace TextDocumentHover |
| 35 |
MAKE_REFLECT_STRUCT(TextDocumentHover::Result, contents, range); |
| 36 |
|
| 37 |
extern void Reflect(Reader& visitor, std::pair<optional<std::string>, optional<lsMarkedString>>& value); |
| 38 |
extern void Reflect(Reader& visitor, TextDocumentHover::Either& value); |
| 39 |
|
| 40 |
DEFINE_REQUEST_RESPONSE_TYPE(td_hover, lsTextDocumentPositionParams, TextDocumentHover::Result, "textDocument/hover") |
| 41 |
|
| 42 |
//struct Rsp_TextDocumentHover : ResponseMessage< TextDocumentHover::Result, Rsp_TextDocumentHover> { |
| 43 |
// |
| 44 |
//}; |
| 45 |
//MAKE_REFLECT_STRUCT(Rsp_TextDocumentHover, |
| 46 |
// jsonrpc, |
| 47 |
// id, |
| 48 |
// result); |
| 49 |
|
| 50 |
//MAKE_REFLECT_STRUCT_OPTIONALS_MANDATORY(Rsp_TextDocumentHover, |
| 51 |
// jsonrpc, |
| 52 |
// id, |
| 53 |
// result); |