Skip to content

Commit 70ede42

Browse files
committed
LSP Protocol: Fix some serialization errors
1 parent c52c154 commit 70ede42

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/LanguageServer/Protocol/Protocol/Internal/Efficiency/OptimizedVSCompletionListJsonConverter.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,8 @@ public override void Write(Utf8JsonWriter writer, OptimizedVSCompletionList valu
5757
JsonSerializer.Serialize(writer, completionList.CommitCharacters, options);
5858
}
5959

60-
if (completionList.IsIncomplete)
61-
{
62-
writer.WriteBoolean("isIncomplete", completionList.IsIncomplete);
63-
}
64-
else
65-
{
66-
// Default is "false" so no need to serialize
67-
}
60+
// this is a required property per the LSP spec
61+
writer.WriteBoolean("isIncomplete", completionList.IsIncomplete);
6862

6963
writer.WritePropertyName("items");
7064
if (completionList.Items == null || completionList.Items.Length == 0)
@@ -153,11 +147,8 @@ private static void WriteCompletionItem(Utf8JsonWriter writer, CompletionItem co
153147
}
154148
}
155149

156-
var label = completionItem.Label;
157-
if (label != null)
158-
{
159-
writer.WriteString("label", label);
160-
}
150+
// label is required per the LSP spec
151+
writer.WriteString("label", completionItem.Label);
161152

162153
if (completionItem.LabelDetails != null)
163154
{

src/LanguageServer/Protocol/Protocol/UnchangedDocumentDiagnosticReport.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal class UnchangedDocumentDiagnosticReport
2121
/// Gets the kind of this report.
2222
/// </summary>
2323
[JsonPropertyName("kind")]
24-
[JsonRequired]
2524
#pragma warning disable CA1822 // Mark members as static
2625
public string Kind => DocumentDiagnosticReportKind.Unchanged;
2726
#pragma warning restore CA1822 // Mark members as static

0 commit comments

Comments
 (0)