blob: 4886be9b46f2b47022a0c1e55eb9571a6a4c3d2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#include "initialize.h"
#include "LibLsp/JsonRpc/json.h"
void Reflect(Reader& reader, lsInitializeParams::lsTrace& value)
{
if (!reader.IsString())
{
value = lsInitializeParams::lsTrace::Off;
return;
}
std::string v = reader.GetString();
if (v == "off")
value = lsInitializeParams::lsTrace::Off;
else if (v == "messages")
value = lsInitializeParams::lsTrace::Messages;
else if (v == "verbose")
value = lsInitializeParams::lsTrace::Verbose;
}
void Reflect(Writer& writer, lsInitializeParams::lsTrace& value)
{
switch (value)
{
case lsInitializeParams::lsTrace::Off:
writer.String("off");
break;
case lsInitializeParams::lsTrace::Messages:
writer.String("messages");
break;
case lsInitializeParams::lsTrace::Verbose:
writer.String("verbose");
break;
}
}
void Reflect(Reader& visitor, std::pair<boost::optional<lsTextDocumentSyncKind>, boost::optional<lsTextDocumentSyncOptions> >& value)
{
if(((JsonReader&)visitor).m_->IsObject())
{
Reflect(visitor, value.second);
}
else
{
Reflect(visitor, value.first);
}
}
|