Skip to content

Commit

Permalink
Remove a few more instances of newtonsoft
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed May 2, 2024
1 parent 1a4c3f4 commit 3fa1ec0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using LSP = Roslyn.LanguageServer.Protocol;

namespace Microsoft.CodeAnalysis.LanguageServer.Handler.CodeActions
Expand Down Expand Up @@ -33,10 +33,10 @@ internal class CodeActionResolveData

public string[] CodeActionPath { get; }

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string[]? FixAllFlavors { get; }

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ImmutableArray<LSP.CodeAction>? NestedCodeActions { get; }

public CodeActionResolveData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Runtime.Serialization;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Roslyn.LanguageServer.Protocol;

namespace Microsoft.CodeAnalysis.LanguageServer.Handler.CodeActions;

[DataContract]
internal sealed class RoslynFixAllCodeAction(string scope) : CodeAction
{
[JsonProperty(PropertyName = "scope")]
[JsonPropertyName("scope")]
public string Scope { get; } = scope;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Roslyn.LanguageServer.Protocol;
using Newtonsoft.Json.Linq;

namespace Microsoft.CodeAnalysis.LanguageServer.Handler.Configuration
{
Expand All @@ -15,7 +15,7 @@ public async Task OnInitializedAsync(ClientCapabilities clientCapabilities, Requ
{
if (clientCapabilities?.Workspace?.DidChangeConfiguration?.DynamicRegistration is true)
{
await _clientLanguageServerManager.SendRequestAsync<RegistrationParams, JObject>(
await _clientLanguageServerManager.SendRequestAsync<RegistrationParams, JsonElement>(
methodName: Methods.ClientRegisterCapabilityName,
@params: new RegistrationParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
// See the LICENSE file in the project root for more information.

using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace Microsoft.CodeAnalysis.LanguageServer.Handler.Testing;

internal record RunTestsPartialResult(
[property: JsonPropertyName("stage")] string Stage,
[property: JsonPropertyName("message")] string Message,
[property: JsonPropertyName("progress"), JsonProperty(NullValueHandling = NullValueHandling.Ignore)] TestProgress? Progress
[property: JsonPropertyName("progress"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] TestProgress? Progress
);

This file was deleted.

0 comments on commit 3fa1ec0

Please sign in to comment.