Skip to content

Commit 57a26b5

Browse files
authored
Update VSInternalContinueCharacter* serialization (#80085)
Exception counts during the RazorEditingTEsts.CompletionInLSP test is off the chart due to JS completion utilizing VSInternalContinueCharacter classes. These classes were being improperly serialized. The vslanguageserverclient part of this change went in via https://devdiv.visualstudio.com/DevDiv/_git/VSLanguageServerClient/pullrequest/665374 and has made it's way to the latest Int.Main. This PR simply does the same thing as the vslnaguageserverclient PR See PR for detailed before/after exception counts in the speedometer run
1 parent c9d25dd commit 57a26b5

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/LanguageServer/Protocol/Protocol/Internal/VSInternalContinueCharacterClass.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ namespace Roslyn.LanguageServer.Protocol;
99
/// <summary>
1010
/// Class representing a unicode character class for completion continuation.
1111
/// </summary>
12+
[Kind(Type, "_vs_type")]
1213
internal sealed class VSInternalContinueCharacterClass
1314
{
15+
public const string Type = "unicodeClass";
16+
1417
/// <summary>
1518
/// Gets the type value.
1619
/// </summary>
1720
[JsonPropertyName("_vs_type")]
1821
[JsonRequired]
19-
public const string Type = "unicodeClass";
22+
[JsonInclude]
23+
internal string TypeDiscriminator = Type;
2024

2125
/// <summary>
2226
/// Gets or sets the unicode class.

src/LanguageServer/Protocol/Protocol/Internal/VSInternalContinueCharacterRange.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ namespace Roslyn.LanguageServer.Protocol;
99
/// <summary>
1010
/// Class representing range of characters for completion continuation.
1111
/// </summary>
12+
[Kind(Type, "_vs_type")]
1213
internal sealed class VSInternalContinueCharacterRange
1314
{
15+
public const string Type = "charRange";
16+
1417
/// <summary>
1518
/// Gets the type value.
1619
/// </summary>
1720
[JsonPropertyName("_vs_type")]
1821
[JsonRequired]
19-
public const string Type = "charRange";
22+
[JsonInclude]
23+
internal string TypeDiscriminator = Type;
2024

2125
/// <summary>
2226
/// Gets or sets the first completion character of the range.

src/LanguageServer/Protocol/Protocol/Internal/VSInternalContinueCharacterSingle.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ namespace Roslyn.LanguageServer.Protocol;
99
/// <summary>
1010
/// Class representing single continue character for completion.
1111
/// </summary>
12+
[Kind(Type, "_vs_type")]
1213
internal sealed class VSInternalContinueCharacterSingle
1314
{
15+
public const string Type = "singleChar";
16+
1417
/// <summary>
1518
/// Gets the type value.
1619
/// </summary>
1720
[JsonPropertyName("_vs_type")]
1821
[JsonRequired]
19-
public const string Type = "singleChar";
22+
[JsonInclude]
23+
internal string TypeDiscriminator = Type;
2024

2125
/// <summary>
2226
/// Gets or sets the completion character.

0 commit comments

Comments
 (0)