| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "LibLsp/JsonRpc/serializer.h" |
| 4 |
|
| 5 |
#include <string> |
| 6 |
#include <vector> |
| 7 |
|
| 8 |
// MarkedString can be used to render human readable text. It is either a |
| 9 |
// markdown string or a code-block that provides a language and a code snippet. |
| 10 |
// The language identifier is sematically equal to the optional language |
| 11 |
// identifier in fenced code blocks in GitHub issues. See |
| 12 |
// https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting |
| 13 |
// |
| 14 |
// The pair of a language and a value is an equivalent to markdown: |
| 15 |
// ```${language} |
| 16 |
// ${value} |
| 17 |
// ``` |
| 18 |
// |
| 19 |
// Note that markdown strings will be sanitized - that means html will be |
| 20 |
// escaped. |
| 21 |
struct lsMarkedString |
| 22 |
{ |
| 23 |
optional<std::string> language; |
| 24 |
std::string value; |
| 25 |
}; |
| 26 |
|
| 27 |
struct MarkupContent |
| 28 |
{ |
| 29 |
/** |
| 30 |
* The type of the Markup. |
| 31 |
*/ |
| 32 |
|
| 33 |
std::string kind; |
| 34 |
|
| 35 |
/** |
| 36 |
* The content itself. |
| 37 |
*/ |
| 38 |
|
| 39 |
std::string value; |
| 40 |
|
| 41 |
MAKE_SWAP_METHOD(MarkupContent, kind, value); |
| 42 |
}; |
| 43 |
MAKE_REFLECT_STRUCT(MarkupContent, kind, value); |
| 44 |
|
| 45 |
void Reflect(Writer& visitor, lsMarkedString& value); |
| 46 |
void Reflect(Reader& visitor, lsMarkedString& value); |