Skip to content

Commit

Permalink
LSP Protocol: Fix some serialization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutch committed Aug 15, 2024
1 parent f165938 commit 3adb76d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,8 @@ public override void Write(Utf8JsonWriter writer, OptimizedVSCompletionList valu
JsonSerializer.Serialize(writer, completionList.CommitCharacters, options);
}

if (completionList.IsIncomplete)
{
writer.WriteBoolean("isIncomplete", completionList.IsIncomplete);
}
else
{
// Default is "false" so no need to serialize
}
// this is a required property per the LSP spec
writer.WriteBoolean("isIncomplete", completionList.IsIncomplete);

writer.WritePropertyName("items");
if (completionList.Items == null || completionList.Items.Length == 0)
Expand Down Expand Up @@ -154,10 +148,7 @@ private static void WriteCompletionItem(Utf8JsonWriter writer, CompletionItem co
}

var label = completionItem.Label;
if (label != null)
{
writer.WriteString("label", label);
}
writer.WriteString("label", label);

if (completionItem.LabelDetails != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ internal class UnchangedDocumentDiagnosticReport
/// Gets the kind of this report.
/// </summary>
[JsonPropertyName("kind")]
[JsonRequired]
#pragma warning disable CA1822 // Mark members as static
public string Kind => DocumentDiagnosticReportKind.Unchanged;
#pragma warning restore CA1822 // Mark members as static
Expand Down

0 comments on commit 3adb76d

Please sign in to comment.