-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Update gladstone/roslyn api #78057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gladstone/roslyn api #78057
Conversation
|
@dibarbet @matteo-prosperi this is ready for review. |
| [property: JsonPropertyName("response"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] string? Response, | ||
| [property: JsonPropertyName("extensionWasUnloaded"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] bool ExtensionWasUnloaded, | ||
| [property: JsonPropertyName("extensionException"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
| ExtensionException? ExtensionException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matteo-prosperi up to you what you will do with this info on the gladstone side.
|
|
||
| // Report any exceptions the extension itself caused while registering and getting the message names. | ||
| if (handlerNames.ExtensionException is not null) | ||
| context.Logger.LogException(handlerNames.ExtensionException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dibarbet i'm still logging this here (as well as passing back to Gladstone). is that ok with you ?
| internal readonly record struct ExtensionMessageResponse( | ||
| [property: JsonPropertyName("response")] string Response); | ||
| [property: JsonPropertyName("response"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] string? Response, | ||
| [property: JsonPropertyName("extensionWasUnloaded"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] bool ExtensionWasUnloaded, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New field to represent a supported failure mode that does not return a respone and was not an exception itself throwing an exception.
| namespace Microsoft.CodeAnalysis.LanguageServer.Handler.Extensions; | ||
|
|
||
| internal sealed record class ExtensionException( | ||
| [property: JsonPropertyName("typeName")] string TypeName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this - however I would have naively started with serializing System.Exception - I assume we don't want that here? I know the exception type may not exist on the other side, but that is something jsonrpc already has to deal with when we throw exceptions for example.
Dependent on #78056