Skip to content

Commit e317cb5

Browse files
Move type
1 parent 39519b7 commit e317cb5

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Text.Json.Serialization;
7+
8+
namespace Microsoft.CodeAnalysis.LanguageServer.Handler.Extensions;
9+
10+
internal sealed record class ExtensionException(
11+
[property: JsonPropertyName("typeName")] string TypeName,
12+
[property: JsonPropertyName("message")] string Message,
13+
[property: JsonPropertyName("stackTrace"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] string? StackTrace,
14+
[property: JsonPropertyName("innerException"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] ExtensionException? InnerException)
15+
{
16+
public static ExtensionException? FromException(Exception? exception)
17+
=> exception is null
18+
? null
19+
: new ExtensionException(exception.GetType().ToString(), exception.Message, exception.StackTrace, FromException(exception.InnerException));
20+
}

src/LanguageServer/Protocol/Handler/Extensions/ExtensionRegisterResponse.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,11 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System;
65
using System.Collections.Immutable;
76
using System.Text.Json.Serialization;
87

98
namespace Microsoft.CodeAnalysis.LanguageServer.Handler.Extensions;
109

11-
internal sealed record class ExtensionException(
12-
[property: JsonPropertyName("typeName")] string TypeName,
13-
[property: JsonPropertyName("message")] string Message,
14-
[property: JsonPropertyName("stackTrace"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] string? StackTrace,
15-
[property: JsonPropertyName("innerException"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] ExtensionException? InnerException)
16-
{
17-
public static ExtensionException? FromException(Exception? exception)
18-
=> exception is null
19-
? null
20-
: new ExtensionException(exception.GetType().ToString(), exception.Message, exception.StackTrace, FromException(exception.InnerException));
21-
}
22-
2310
/// <summary>
2411
/// Response for the roslyn/extensionRegister request.
2512
/// </summary>

0 commit comments

Comments
 (0)