Skip to content

Revert manual pin of Newtonsoft.Json #1962

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

Merged
merged 2 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/PowerShellEditorServices/PowerShellEditorServices.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<!-- Manually pull in the updated version of Newtonsoft.Json. -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!-- TODO: Manually pull in the updated version of Newtonsoft.Json after OmniSharp updates. -->
<!-- PackageReference Include="Newtonsoft.Json" Version="13.0.1" -->
<PackageReference Include="OmniSharp.Extensions.LanguageServer" Version="0.19.6" />
<PackageReference Include="OmniSharp.Extensions.DebugAdapter.Server" Version="0.19.6" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
Expand Down
4 changes: 3 additions & 1 deletion src/PowerShellEditorServices/Server/PsesDebugServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
Expand Down Expand Up @@ -89,6 +89,8 @@ public async Task StartAsync()
{
// Start the host if not already started, and enable debug mode (required
// for remote debugging).
//
// TODO: We might need to fill in HostStartOptions here.
_startedPses = !await _psesHost.TryStartAsync(new HostStartOptions(), cancellationToken).ConfigureAwait(false);
_psesHost.DebugContext.EnableDebugMode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ public async Task<CodeLens> ResolveCodeLens(
Title = GetReferenceCountHeader(referenceLocations.Length),
Arguments = JArray.FromObject(new object[]
{
scriptFile.DocumentUri,
codeLens.Range.Start,
referenceLocations
scriptFile.DocumentUri,
codeLens.Range.Start,
referenceLocations
},
LspSerializer.Instance.JsonSerializer)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Logging;
using Microsoft.PowerShell.EditorServices.Services;
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
using Microsoft.PowerShell.EditorServices.Utility;
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;

namespace Microsoft.PowerShell.EditorServices.Handlers
{
Expand Down Expand Up @@ -131,7 +133,11 @@ public override async Task<CommandOrCodeActionContainer> Handle(CodeActionParams
{
Title = title,
Name = "PowerShell.ShowCodeActionDocumentation",
Arguments = Newtonsoft.Json.Linq.JArray.FromObject(new[] { diagnostic.Code?.String })
Arguments = JArray.FromObject(new object[]
{
diagnostic.Code?.String
},
LspSerializer.Instance.JsonSerializer)
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ internal static bool IsPathInMemory(string filePath)

internal string ResolveRelativeScriptPath(string baseFilePath, string relativePath)
{
// TODO: Sometimes the `baseFilePath` (even when its `WorkspacePath`) is null.
string combinedPath = null;
Exception resolveException = null;

Expand Down