Skip to content

Commit 6bfb6b2

Browse files
Merge pull request #1962 from PowerShell/andschwa/revert-pin
Revert manual pin of Newtonsoft.Json
2 parents ab8bfa3 + 142b7f4 commit 6bfb6b2

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

src/PowerShellEditorServices/PowerShellEditorServices.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
2929
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
3030
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
31-
<!-- Manually pull in the updated version of Newtonsoft.Json. -->
32-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
31+
<!-- TODO: Manually pull in the updated version of Newtonsoft.Json after OmniSharp updates. -->
32+
<!-- PackageReference Include="Newtonsoft.Json" Version="13.0.1" -->
3333
<PackageReference Include="OmniSharp.Extensions.LanguageServer" Version="0.19.6" />
3434
<PackageReference Include="OmniSharp.Extensions.DebugAdapter.Server" Version="0.19.6" />
3535
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />

src/PowerShellEditorServices/Server/PsesDebugServer.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

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

src/PowerShellEditorServices/Services/CodeLens/ReferencesCodeLensProvider.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ public async Task<CodeLens> ResolveCodeLens(
154154
Title = GetReferenceCountHeader(referenceLocations.Length),
155155
Arguments = JArray.FromObject(new object[]
156156
{
157-
scriptFile.DocumentUri,
158-
codeLens.Range.Start,
159-
referenceLocations
157+
scriptFile.DocumentUri,
158+
codeLens.Range.Start,
159+
referenceLocations
160160
},
161161
LspSerializer.Instance.JsonSerializer)
162162
}

src/PowerShellEditorServices/Services/TextDocument/Handlers/CodeActionHandler.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
using System.Collections.Generic;
66
using System.Threading;
77
using System.Threading.Tasks;
8+
using Newtonsoft.Json.Linq;
89
using Microsoft.Extensions.Logging;
910
using Microsoft.PowerShell.EditorServices.Services;
1011
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
1112
using Microsoft.PowerShell.EditorServices.Utility;
1213
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
1314
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
1415
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
16+
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
1517

1618
namespace Microsoft.PowerShell.EditorServices.Handlers
1719
{
@@ -131,7 +133,11 @@ public override async Task<CommandOrCodeActionContainer> Handle(CodeActionParams
131133
{
132134
Title = title,
133135
Name = "PowerShell.ShowCodeActionDocumentation",
134-
Arguments = Newtonsoft.Json.Linq.JArray.FromObject(new[] { diagnostic.Code?.String })
136+
Arguments = JArray.FromObject(new object[]
137+
{
138+
diagnostic.Code?.String
139+
},
140+
LspSerializer.Instance.JsonSerializer)
135141
}
136142
});
137143
}

src/PowerShellEditorServices/Services/Workspace/WorkspaceService.cs

+1
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ internal static bool IsPathInMemory(string filePath)
506506

507507
internal string ResolveRelativeScriptPath(string baseFilePath, string relativePath)
508508
{
509+
// TODO: Sometimes the `baseFilePath` (even when its `WorkspacePath`) is null.
509510
string combinedPath = null;
510511
Exception resolveException = null;
511512

0 commit comments

Comments
 (0)