Skip to content

Commit 908a6df

Browse files
committed
Completions working
1 parent bef1740 commit 908a6df

15 files changed

+431
-351
lines changed

integrated.sln

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26124.0
5+
MinimumVisualStudioVersion = 15.0.26124.0
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{31BB87E9-A4A1-4266-B150-CEACE7C424C4}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices", "src\PowerShellEditorServices\PowerShellEditorServices.csproj", "{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Hosting", "src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj", "{C6D0523A-B537-4115-ADB3-218E902684DA}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.VSCode", "src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj", "{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Management.Automation", "..\PowerShell\src\System.Management.Automation\System.Management.Automation.csproj", "{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSReadLine", "..\PSReadLine\PSReadLine\PSReadLine.csproj", "{DB03A789-7930-4BB2-B01E-65C2A754FC42}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine", "..\PSScriptAnalyzer\Engine\Engine.csproj", "{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}"
19+
EndProject
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rules", "..\PSScriptAnalyzer\Rules\Rules.csproj", "{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}"
21+
EndProject
22+
Global
23+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
24+
Debug|Any CPU = Debug|Any CPU
25+
Debug|x64 = Debug|x64
26+
Debug|x86 = Debug|x86
27+
Release|Any CPU = Release|Any CPU
28+
Release|x64 = Release|x64
29+
Release|x86 = Release|x86
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
35+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Debug|Any CPU.Build.0 = Debug|Any CPU
37+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Debug|x64.ActiveCfg = Debug|Any CPU
38+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Debug|x64.Build.0 = Debug|Any CPU
39+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Debug|x86.ActiveCfg = Debug|Any CPU
40+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Debug|x86.Build.0 = Debug|Any CPU
41+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Release|Any CPU.ActiveCfg = Release|Any CPU
42+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Release|x64.ActiveCfg = Release|Any CPU
44+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Release|x64.Build.0 = Release|Any CPU
45+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Release|x86.ActiveCfg = Release|Any CPU
46+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09}.Release|x86.Build.0 = Release|Any CPU
47+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
49+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Debug|x64.ActiveCfg = Debug|Any CPU
50+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Debug|x64.Build.0 = Debug|Any CPU
51+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Debug|x86.ActiveCfg = Debug|Any CPU
52+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Debug|x86.Build.0 = Debug|Any CPU
53+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
54+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Release|Any CPU.Build.0 = Release|Any CPU
55+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Release|x64.ActiveCfg = Release|Any CPU
56+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Release|x64.Build.0 = Release|Any CPU
57+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Release|x86.ActiveCfg = Release|Any CPU
58+
{C6D0523A-B537-4115-ADB3-218E902684DA}.Release|x86.Build.0 = Release|Any CPU
59+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Debug|Any CPU.Build.0 = Debug|Any CPU
61+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Debug|x64.ActiveCfg = Debug|Any CPU
62+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Debug|x64.Build.0 = Debug|Any CPU
63+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Debug|x86.ActiveCfg = Debug|Any CPU
64+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Debug|x86.Build.0 = Debug|Any CPU
65+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Release|Any CPU.ActiveCfg = Release|Any CPU
66+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Release|Any CPU.Build.0 = Release|Any CPU
67+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Release|x64.ActiveCfg = Release|Any CPU
68+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Release|x64.Build.0 = Release|Any CPU
69+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Release|x86.ActiveCfg = Release|Any CPU
70+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37}.Release|x86.Build.0 = Release|Any CPU
71+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Debug|x64.ActiveCfg = Debug|Any CPU
74+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Debug|x64.Build.0 = Debug|Any CPU
75+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Debug|x86.ActiveCfg = Debug|Any CPU
76+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Debug|x86.Build.0 = Debug|Any CPU
77+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Release|Any CPU.Build.0 = Release|Any CPU
79+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Release|x64.ActiveCfg = Release|Any CPU
80+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Release|x64.Build.0 = Release|Any CPU
81+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Release|x86.ActiveCfg = Release|Any CPU
82+
{1C80C3F5-16DD-4385-8C2D-EE38DA2C5EA4}.Release|x86.Build.0 = Release|Any CPU
83+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Debug|Any CPU.Build.0 = Debug|Any CPU
85+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Debug|x64.ActiveCfg = Debug|Any CPU
86+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Debug|x64.Build.0 = Debug|Any CPU
87+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Debug|x86.ActiveCfg = Debug|Any CPU
88+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Debug|x86.Build.0 = Debug|Any CPU
89+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Release|Any CPU.ActiveCfg = Release|Any CPU
90+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Release|Any CPU.Build.0 = Release|Any CPU
91+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Release|x64.ActiveCfg = Release|Any CPU
92+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Release|x64.Build.0 = Release|Any CPU
93+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Release|x86.ActiveCfg = Release|Any CPU
94+
{DB03A789-7930-4BB2-B01E-65C2A754FC42}.Release|x86.Build.0 = Release|Any CPU
95+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
96+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Debug|Any CPU.Build.0 = Debug|Any CPU
97+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Debug|x64.ActiveCfg = Debug|Any CPU
98+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Debug|x64.Build.0 = Debug|Any CPU
99+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Debug|x86.ActiveCfg = Debug|Any CPU
100+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Debug|x86.Build.0 = Debug|Any CPU
101+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Release|Any CPU.ActiveCfg = Release|Any CPU
102+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Release|Any CPU.Build.0 = Release|Any CPU
103+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Release|x64.ActiveCfg = Release|Any CPU
104+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Release|x64.Build.0 = Release|Any CPU
105+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Release|x86.ActiveCfg = Release|Any CPU
106+
{04D0D7FD-DC38-4BE0-BE9A-54DBC978F201}.Release|x86.Build.0 = Release|Any CPU
107+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
108+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
109+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Debug|x64.ActiveCfg = Debug|Any CPU
110+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Debug|x64.Build.0 = Debug|Any CPU
111+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Debug|x86.ActiveCfg = Debug|Any CPU
112+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Debug|x86.Build.0 = Debug|Any CPU
113+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
114+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Release|Any CPU.Build.0 = Release|Any CPU
115+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Release|x64.ActiveCfg = Release|Any CPU
116+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Release|x64.Build.0 = Release|Any CPU
117+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Release|x86.ActiveCfg = Release|Any CPU
118+
{6F224847-AC0E-4901-B5BA-7DE81D8B3FBC}.Release|x86.Build.0 = Release|Any CPU
119+
EndGlobalSection
120+
GlobalSection(NestedProjects) = preSolution
121+
{00158E75-B6E0-43E4-98E9-BDAC8EEF4C09} = {31BB87E9-A4A1-4266-B150-CEACE7C424C4}
122+
{C6D0523A-B537-4115-ADB3-218E902684DA} = {31BB87E9-A4A1-4266-B150-CEACE7C424C4}
123+
{6A33B29C-74FE-43C2-9207-CE51DC2ABF37} = {31BB87E9-A4A1-4266-B150-CEACE7C424C4}
124+
EndGlobalSection
125+
EndGlobal

src/PowerShellEditorServices/Server/PsesServiceCollectionExtensions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ public static IServiceCollection AddPsesLanguageServices(
2121
return collection.AddSingleton<WorkspaceService>()
2222
.AddSingleton<SymbolsService>()
2323
.AddSingleton<ConfigurationService>()
24-
.AddSingleton<PowerShellStartupService>(
25-
(provider) => PowerShellStartupService.Create(provider.GetService<ILogger>(), hostStartupInfo))
2624
.AddSingleton<PowerShellExecutionService>(
27-
(provider) => PowerShellExecutionService.CreateAndStart(provider.GetService<ILogger>(), hostStartupInfo, provider.GetService<PowerShellStartupService>()))
25+
(provider) => PowerShellExecutionService.CreateAndStart(provider.GetService<ILoggerFactory>(), hostStartupInfo))
2826
.AddSingleton<PowerShellConsoleService>(
29-
(provider) => PowerShellConsoleService.CreateAndStart(provider.GetService<ILogger>(), provider.GetService<PowerShellStartupService>(), provider.GetService<PowerShellExecutionService>()))
27+
(provider) => PowerShellConsoleService.CreateAndStart(provider.GetService<ILoggerFactory>(), provider.GetService<PowerShellExecutionService>()))
3028
.AddSingleton<TemplateService>()
3129
.AddSingleton<EditorOperationsService>()
3230
.AddSingleton<RemoteFileManagerService>()

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,19 @@ internal class ConsoleReadLine
2222
{
2323
private PSReadLineProxy _psrlProxy;
2424

25-
private EngineIntrinsics _engineIntrinsics;
26-
2725
private PowerShellExecutionService _executionService;
2826

29-
private EditorServicesConsolePSHost _editorServicesHost;
30-
3127
#region Constructors
3228

3329
#endregion
3430

3531
#region Public Methods
3632

37-
public void RegisterPowerShellEngine(EditorServicesConsolePSHost editorServicesHost, EngineIntrinsics engineIntrinsics)
38-
{
39-
_editorServicesHost = editorServicesHost;
40-
_engineIntrinsics = engineIntrinsics;
41-
}
42-
43-
public void RegisterExecutionService(PowerShellExecutionService executionService)
33+
public void RegisterExecutionDependencies(
34+
PowerShellExecutionService executionService,
35+
PSReadLineProxy psrlProxy)
4436
{
4537
_executionService = executionService;
46-
}
47-
48-
public void RegisterPSReadLineProxy(PSReadLineProxy psrlProxy)
49-
{
5038
_psrlProxy = psrlProxy;
5139
}
5240

@@ -156,10 +144,9 @@ private Task<string> ReadLineAsync(bool isCommandLine, CancellationToken cancell
156144

157145
private string InvokePSReadLine(CancellationToken cancellationToken)
158146
{
159-
return _psrlProxy.ReadLine(_editorServicesHost.Runspace, _engineIntrinsics, cancellationToken);
147+
return _psrlProxy.ReadLine(_executionService.EditorServicesHost.Runspace, _executionService.EngineIntrinsics, cancellationToken);
160148
}
161149

162-
163150
/// <summary>
164151
/// Invokes a custom ReadLine method that is similar to but more basic than PSReadLine.
165152
/// This method should be used when PSReadLine is disabled, either by user settings or

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

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ internal class PSReadLineProxy
3131

3232
private const string ReadKeyOverrideFieldName = "_readKeyOverride";
3333

34+
private const string HandleIdleOverrideName = "_handleIdleOverride";
35+
3436
private const string VirtualTerminalTypeName = "Microsoft.PowerShell.Internal.VirtualTerminal";
3537

3638
private const string ForcePSEventHandlingMethodName = "ForcePSEventHandling";
@@ -72,7 +74,7 @@ internal class PSReadLineProxy
7274
}}";
7375

7476
public static PSReadLineProxy LoadAndCreate(
75-
ILogger logger,
77+
ILoggerFactory loggerFactory,
7678
SMA.PowerShell pwsh)
7779
{
7880
Type psConsoleReadLineType = pwsh.AddScript(ReadLineInitScript).InvokeAndClear<Type>().FirstOrDefault();
@@ -81,15 +83,21 @@ public static PSReadLineProxy LoadAndCreate(
8183

8284
RuntimeHelpers.RunClassConstructor(type.TypeHandle);
8385

84-
return new PSReadLineProxy(logger, psConsoleReadLineType);
86+
return new PSReadLineProxy(loggerFactory, psConsoleReadLineType);
8587
}
8688

8789
private readonly FieldInfo _readKeyOverrideField;
8890

91+
private readonly FieldInfo _handleIdleOverrideField;
92+
93+
private readonly ILogger _logger;
94+
8995
public PSReadLineProxy(
90-
ILogger logger,
96+
ILoggerFactory loggerFactory,
9197
Type psConsoleReadLine)
9298
{
99+
_logger = loggerFactory.CreateLogger<PSReadLineProxy>();
100+
93101
ReadLine = (Func<Runspace, EngineIntrinsics, CancellationToken, string>)psConsoleReadLine.GetMethod(
94102
ReadLineMethodName,
95103
new[] { typeof(Runspace), typeof(EngineIntrinsics), typeof(CancellationToken) })
@@ -110,6 +118,8 @@ public PSReadLineProxy(
110118
s_setKeyHandlerTypes)
111119
?.CreateDelegate(typeof(Action<string[], Action<ConsoleKeyInfo?, object>, string, string>));
112120

121+
_handleIdleOverrideField = psConsoleReadLine.GetField(HandleIdleOverrideName, BindingFlags.Static | BindingFlags.NonPublic);
122+
113123
_readKeyOverrideField = psConsoleReadLine.GetTypeInfo().Assembly
114124
.GetType(VirtualTerminalTypeName)
115125
?.GetField(ReadKeyOverrideFieldName, BindingFlags.Static | BindingFlags.NonPublic);
@@ -119,39 +129,39 @@ public PSReadLineProxy(
119129
throw NewInvalidPSReadLineVersionException(
120130
FieldMemberType,
121131
ReadKeyOverrideFieldName,
122-
logger);
132+
_logger);
123133
}
124134

125135
if (ReadLine == null)
126136
{
127137
throw NewInvalidPSReadLineVersionException(
128138
MethodMemberType,
129139
ReadLineMethodName,
130-
logger);
140+
_logger);
131141
}
132142

133143
if (SetKeyHandler == null)
134144
{
135145
throw NewInvalidPSReadLineVersionException(
136146
MethodMemberType,
137147
SetKeyHandlerMethodName,
138-
logger);
148+
_logger);
139149
}
140150

141151
if (AddToHistory == null)
142152
{
143153
throw NewInvalidPSReadLineVersionException(
144154
MethodMemberType,
145155
AddToHistoryMethodName,
146-
logger);
156+
_logger);
147157
}
148158

149159
if (ForcePSEventHandling == null)
150160
{
151161
throw NewInvalidPSReadLineVersionException(
152162
MethodMemberType,
153163
ForcePSEventHandlingMethodName,
154-
logger);
164+
_logger);
155165
}
156166
}
157167

@@ -168,6 +178,11 @@ internal void OverrideReadKey(Func<bool, ConsoleKeyInfo> readKeyFunc)
168178
_readKeyOverrideField.SetValue(null, readKeyFunc);
169179
}
170180

181+
internal void OverrideIdleHandler(Action idleAction)
182+
{
183+
_handleIdleOverrideField.SetValue(null, idleAction);
184+
}
185+
171186
private static InvalidOperationException NewInvalidPSReadLineVersionException(
172187
string memberType,
173188
string memberName,

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.Extensions.Logging;
2-
using Microsoft.PowerShell.EditorServices.Hosting;
2+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Console;
33
using System;
44
using System.Globalization;
55
using System.Management.Automation.Host;
@@ -14,16 +14,17 @@ internal class EditorServicesConsolePSHost : PSHost, IHostSupportsInteractiveSes
1414
private Runspace _pushedRunspace;
1515

1616
public EditorServicesConsolePSHost(
17-
ILogger logger,
18-
EditorServicesConsolePSHostUserInterface ui,
17+
ILoggerFactory loggerFactory,
1918
string name,
20-
Version version)
19+
Version version,
20+
PSHost internalHost,
21+
ConsoleReadLine readline)
2122
{
22-
_logger = logger;
23+
_logger = loggerFactory.CreateLogger<EditorServicesConsolePSHost>();
2324
_pushedRunspace = null;
2425
Name = name;
2526
Version = version;
26-
UI = ui;
27+
UI = new EditorServicesConsolePSHostUserInterface(loggerFactory, readline, internalHost.UI);
2728
}
2829

2930
public override CultureInfo CurrentCulture => CultureInfo.CurrentCulture;
@@ -81,5 +82,10 @@ public override void SetShouldExit(int exitCode)
8182
PopRunspace();
8283
}
8384
}
85+
86+
public void RegisterRunspace(Runspace runspace)
87+
{
88+
Runspace = runspace;
89+
}
8490
}
8591
}

0 commit comments

Comments
 (0)