Skip to content

Commit de18309

Browse files
committed
Remove unneeded internal usings
1 parent 08e2f69 commit de18309

File tree

11 files changed

+114
-126
lines changed

11 files changed

+114
-126
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/Handlers/ConfigurationDoneHandler.cs

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

4-
using System.Collections.Generic;
5-
using System.Management.Automation;
6-
using System.Management.Automation.Language;
7-
using System.Text;
8-
using System.Threading;
9-
using System.Threading.Tasks;
104
using Microsoft.Extensions.Logging;
115
using Microsoft.PowerShell.EditorServices.Services;
126
using Microsoft.PowerShell.EditorServices.Services.DebugAdapter;
@@ -19,6 +13,12 @@
1913
using OmniSharp.Extensions.DebugAdapter.Protocol.Events;
2014
using OmniSharp.Extensions.DebugAdapter.Protocol.Requests;
2115
using OmniSharp.Extensions.DebugAdapter.Protocol.Server;
16+
using System.Collections.Generic;
17+
using System.Management.Automation;
18+
using System.Management.Automation.Language;
19+
using System.Text;
20+
using System.Threading;
21+
using System.Threading.Tasks;
2222

2323
namespace Microsoft.PowerShell.EditorServices.Handlers
2424
{

src/PowerShellEditorServices/Services/PowerShell/Console/ConsoleReadLine.cs

+7-8
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33

44
using System.Text;
55
using System.Threading;
6+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution;
7+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
8+
using System;
9+
using System.Collections.Generic;
10+
using System.Management.Automation;
11+
using System.Management.Automation.Language;
12+
using System.Security;
613

714
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Console
815
{
9-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution;
10-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
11-
using System;
12-
using System.Collections.Generic;
13-
using System.Management.Automation;
14-
using System.Management.Automation.Language;
15-
using System.Security;
16-
1716
internal class ConsoleReadLine : IReadLine
1817
{
1918
private readonly PSReadLineProxy _psrlProxy;

src/PowerShellEditorServices/Services/PowerShell/Context/PowerShellVersionDetails.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Licensed under the MIT License.
33

44
using Microsoft.Extensions.Logging;
5+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
56
using System;
67
using System.Collections;
78
using System.Linq;
89

910
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Context
1011
{
11-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
1212
using System.Management.Automation;
1313

1414
/// <summary>

src/PowerShellEditorServices/Services/PowerShell/Debugging/PowerShellDebugContext.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
using System;
55
using System.Management.Automation;
66
using System.Threading;
7+
using Microsoft.Extensions.Logging;
8+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
9+
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
10+
using System.Threading.Tasks;
711

812
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Debugging
913
{
10-
using Microsoft.Extensions.Logging;
11-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
12-
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
13-
using System.Threading.Tasks;
14-
1514
/// <summary>
1615
/// Handles the state of the PowerShell debugger.
1716
/// </summary>

src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.Extensions.Logging;
55
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
66
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
7+
using Microsoft.PowerShell.EditorServices.Utility;
78
using System;
89
using System.Collections.Generic;
910
using System.Collections.ObjectModel;

src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs

+16-17
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@
1111
using System.Collections.Generic;
1212
using System.Globalization;
1313
using System.Management.Automation.Host;
14-
using SMA = System.Management.Automation;
14+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Debugging;
15+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution;
16+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
17+
using Microsoft.PowerShell.EditorServices.Utility;
18+
using System.IO;
19+
using System.Reflection;
20+
using System.Text;
21+
using System.Threading;
22+
using System.Threading.Tasks;
1523

1624
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Host
1725
{
18-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Debugging;
19-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution;
20-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
21-
using Microsoft.PowerShell.EditorServices.Utility;
22-
using System.IO;
2326
using System.Management.Automation;
2427
using System.Management.Automation.Runspaces;
25-
using System.Reflection;
26-
using System.Text;
27-
using System.Threading;
28-
using System.Threading.Tasks;
2928

3029
internal class PsesInternalHost : PSHost, IHostSupportsInteractiveSession, IRunspaceContext, IInternalPowerShellExecutionService
3130
{
@@ -117,7 +116,7 @@ public PsesInternalHost(
117116

118117
public RunspaceInfo CurrentRunspace => CurrentFrame.RunspaceInfo;
119118

120-
public SMA.PowerShell CurrentPowerShell => CurrentFrame.PowerShell;
119+
public PowerShell CurrentPowerShell => CurrentFrame.PowerShell;
121120

122121
public EditorServicesConsolePSHost PublicHost { get; }
123122

@@ -253,7 +252,7 @@ public void CancelCurrentTask()
253252
public Task<TResult> ExecuteDelegateAsync<TResult>(
254253
string representation,
255254
ExecutionOptions executionOptions,
256-
Func<SMA.PowerShell, CancellationToken, TResult> func,
255+
Func<PowerShell, CancellationToken, TResult> func,
257256
CancellationToken cancellationToken)
258257
{
259258
return InvokeTaskOnPipelineThreadAsync(new SynchronousPSDelegateTask<TResult>(_logger, this, representation, executionOptions ?? ExecutionOptions.Default, func, cancellationToken));
@@ -262,7 +261,7 @@ public Task<TResult> ExecuteDelegateAsync<TResult>(
262261
public Task ExecuteDelegateAsync(
263262
string representation,
264263
ExecutionOptions executionOptions,
265-
Action<SMA.PowerShell, CancellationToken> action,
264+
Action<PowerShell, CancellationToken> action,
266265
CancellationToken cancellationToken)
267266
{
268267
return InvokeTaskOnPipelineThreadAsync(new SynchronousPSDelegateTask(_logger, this, representation, executionOptions ?? ExecutionOptions.Default, action, cancellationToken));
@@ -325,13 +324,13 @@ public IReadOnlyList<TResult> InvokePSCommand<TResult>(PSCommand psCommand, Powe
325324
public void InvokePSCommand(PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken)
326325
=> InvokePSCommand<PSObject>(psCommand, executionOptions, cancellationToken);
327326

328-
public TResult InvokePSDelegate<TResult>(string representation, ExecutionOptions executionOptions, Func<SMA.PowerShell, CancellationToken, TResult> func, CancellationToken cancellationToken)
327+
public TResult InvokePSDelegate<TResult>(string representation, ExecutionOptions executionOptions, Func<PowerShell, CancellationToken, TResult> func, CancellationToken cancellationToken)
329328
{
330329
var task = new SynchronousPSDelegateTask<TResult>(_logger, this, representation, executionOptions, func, cancellationToken);
331330
return task.ExecuteAndGetResult(cancellationToken);
332331
}
333332

334-
public void InvokePSDelegate(string representation, ExecutionOptions executionOptions, Action<SMA.PowerShell, CancellationToken> action, CancellationToken cancellationToken)
333+
public void InvokePSDelegate(string representation, ExecutionOptions executionOptions, Action<PowerShell, CancellationToken> action, CancellationToken cancellationToken)
335334
{
336335
var task = new SynchronousPSDelegateTask(_logger, this, representation, executionOptions, action, cancellationToken);
337336
task.ExecuteAndGetResult(cancellationToken);
@@ -361,7 +360,7 @@ private void Run()
361360
return (pwsh, localRunspaceInfo);
362361
}
363362

364-
private void PushPowerShellAndRunLoop(SMA.PowerShell pwsh, PowerShellFrameType frameType, RunspaceInfo newRunspaceInfo = null)
363+
private void PushPowerShellAndRunLoop(PowerShell pwsh, PowerShellFrameType frameType, RunspaceInfo newRunspaceInfo = null)
365364
{
366365
// TODO: Improve runspace origin detection here
367366
if (newRunspaceInfo is null)
@@ -379,7 +378,7 @@ private void PushPowerShellAndRunLoop(SMA.PowerShell pwsh, PowerShellFrameType f
379378
PushPowerShellAndRunLoop(new PowerShellContextFrame(pwsh, newRunspaceInfo, frameType));
380379
}
381380

382-
private RunspaceInfo GetRunspaceInfoForPowerShell(SMA.PowerShell pwsh, out bool isNewRunspace, out RunspaceFrame oldRunspaceFrame)
381+
private RunspaceInfo GetRunspaceInfoForPowerShell(PowerShell pwsh, out bool isNewRunspace, out RunspaceFrame oldRunspaceFrame)
383382
{
384383
oldRunspaceFrame = null;
385384

src/PowerShellEditorServices/Services/PowerShell/Runspace/RunspaceInfo.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Context;
55
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Debugging;
6+
using Microsoft.Extensions.Logging;
7+
using System.Threading.Tasks;
8+
using System.Threading;
9+
using System;
10+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
611

712
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Runspace
813
{
9-
using System.Management.Automation.Runspaces;
1014
using System.Management.Automation;
11-
using Microsoft.Extensions.Logging;
12-
using System.Threading.Tasks;
13-
using System.Threading;
14-
using System;
15-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
15+
using System.Management.Automation.Runspaces;
1616

1717
internal class RunspaceInfo : IRunspaceInfo
1818
{

src/PowerShellEditorServices/Services/PowerShell/Runspace/SessionDetails.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
using System;
55
using System.Collections;
6+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
7+
using System.Linq;
68

79
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Runspace
810
{
9-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
10-
using System.Linq;
1111
using System.Management.Automation;
1212

1313
/// <summary>

src/PowerShellEditorServices/Services/PowerShell/Utility/PSCommandExtensions.cs

-76
This file was deleted.

src/PowerShellEditorServices/Services/PowerShell/Utility/PowerShellExtensions.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
using System.Collections.ObjectModel;
66
using System.Reflection;
77
using System.Text;
8+
using Microsoft.Extensions.Logging;
9+
using Microsoft.PowerShell.EditorServices.Hosting;
10+
using Microsoft.PowerShell.EditorServices.Utility;
11+
using System.Collections.Generic;
12+
using System.IO;
813

914
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility
1015
{
11-
using Microsoft.Extensions.Logging;
12-
using Microsoft.PowerShell.EditorServices.Hosting;
13-
using System.Collections.Generic;
14-
using System.IO;
1516
using System.Management.Automation;
1617

1718
internal static class PowerShellExtensions

0 commit comments

Comments
 (0)