Skip to content

Commit 0e2f0a1

Browse files
committed
Remove unnecessary PowerShellContextService.Initialize overload
1 parent c3a4383 commit 0e2f0a1

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -296,21 +296,6 @@ public static Runspace CreateRunspace(PSHost psHost, PSLanguageMode languageMode
296296
return runspace;
297297
}
298298

299-
/// <summary>
300-
/// Initializes a new instance of the PowerShellContext class using
301-
/// an existing runspace for the session.
302-
/// </summary>
303-
/// <param name="profilePaths">An object containing the profile paths for the session.</param>
304-
/// <param name="initialRunspace">The initial runspace to use for this instance.</param>
305-
/// <param name="ownsInitialRunspace">If true, the PowerShellContext owns this runspace.</param>
306-
public void Initialize(
307-
ProfilePathInfo profilePaths,
308-
Runspace initialRunspace,
309-
bool ownsInitialRunspace)
310-
{
311-
this.Initialize(profilePaths, initialRunspace, ownsInitialRunspace, consoleHost: null);
312-
}
313-
314299
/// <summary>
315300
/// Initializes a new instance of the PowerShellContext class using
316301
/// an existing runspace for the session.

test/PowerShellEditorServices.Test/PowerShellContextFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public static PowerShellContextService Create(ILogger logger)
5858
powerShellContext,
5959
new TestPSHostUserInterface(powerShellContext, logger),
6060
logger),
61-
true);
61+
ownsInitialRunspace: true,
62+
consoleHost: null);
6263

6364
return powerShellContext;
6465
}

test/PowerShellEditorServices.Test/Session/PowerShellContextTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
using Microsoft.Extensions.Logging.Abstractions;
5-
using Microsoft.PowerShell.EditorServices.Services;
6-
using Microsoft.PowerShell.EditorServices.Services.PowerShellContext;
7-
using Microsoft.PowerShell.EditorServices.Test.Shared;
8-
using Microsoft.PowerShell.EditorServices.Utility;
94
using System;
105
using System.Collections.Generic;
116
using System.IO;
127
using System.Linq;
138
using System.Management.Automation;
149
using System.Threading.Tasks;
10+
using Microsoft.Extensions.Logging.Abstractions;
11+
using Microsoft.PowerShell.EditorServices.Services;
12+
using Microsoft.PowerShell.EditorServices.Services.PowerShellContext;
13+
using Microsoft.PowerShell.EditorServices.Test.Shared;
14+
using Microsoft.PowerShell.EditorServices.Utility;
1515
using Xunit;
1616

1717
namespace Microsoft.PowerShell.EditorServices.Test.Console

0 commit comments

Comments
 (0)