Skip to content

Commit

Permalink
JsonWriter: write "null" if VersionedTextDocumentIdentifier.version i…
Browse files Browse the repository at this point in the history
…s null

Fix MaskRay#387
  • Loading branch information
MaskRay committed Nov 10, 2019
1 parent 137a9cd commit bd0006a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/message_handler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,22 @@ struct WorkspaceSymbolParam {
};
REFLECT_STRUCT(WorkspaceFolder, uri, name);

inline void Reflect(JsonReader &visitor, DocumentUri &value) {
Reflect(visitor, value.raw_uri);
inline void Reflect(JsonReader &vis, DocumentUri &v) {
Reflect(vis, v.raw_uri);
}
inline void Reflect(JsonWriter &visitor, DocumentUri &value) {
Reflect(visitor, value.raw_uri);
inline void Reflect(JsonWriter &vis, DocumentUri &v) {
Reflect(vis, v.raw_uri);
}
inline void Reflect(JsonReader &vis, VersionedTextDocumentIdentifier &v) {
REFLECT_MEMBER(uri);
REFLECT_MEMBER(version);
}
inline void Reflect(JsonWriter &vis, VersionedTextDocumentIdentifier &v) {
vis.StartObject();
REFLECT_MEMBER(uri);
vis.Key("version");
Reflect(vis, v.version);
vis.EndObject();
}

REFLECT_UNDERLYING(ErrorCode);
Expand All @@ -182,7 +193,6 @@ REFLECT_UNDERLYING_B(SymbolKind);
REFLECT_STRUCT(TextDocumentIdentifier, uri);
REFLECT_STRUCT(TextDocumentItem, uri, languageId, version, text);
REFLECT_STRUCT(TextEdit, range, newText);
REFLECT_STRUCT(VersionedTextDocumentIdentifier, uri, version);
REFLECT_STRUCT(DiagnosticRelatedInformation, location, message);
REFLECT_STRUCT(Diagnostic, range, severity, code, source, message, relatedInformation);
REFLECT_STRUCT(ShowMessageParam, type, message);
Expand Down

0 comments on commit bd0006a

Please sign in to comment.