diff --git a/module/PowerShellEditorServices/PowerShellEditorServices.psm1 b/module/PowerShellEditorServices/PowerShellEditorServices.psm1 index 84ee85940..c2ee6cec7 100644 --- a/module/PowerShellEditorServices/PowerShellEditorServices.psm1 +++ b/module/PowerShellEditorServices/PowerShellEditorServices.psm1 @@ -52,6 +52,10 @@ function Start-EditorServicesHost { [string] $DebugServiceOnly, + [string[]] + [ValidateNotNull()] + $FeatureFlags = @(), + [switch] $WaitForDebugger ) @@ -65,7 +69,8 @@ function Start-EditorServicesHost { $hostDetails, $BundledModulesPath, $EnableConsoleRepl.IsPresent, - $WaitForDebugger.IsPresent) + $WaitForDebugger.IsPresent, + $FeatureFlags) # Build the profile paths using the root paths of the current $profile variable $profilePaths = New-Object Microsoft.PowerShell.EditorServices.Session.ProfilePaths @( diff --git a/src/PowerShellEditorServices.Host/EditorServicesHost.cs b/src/PowerShellEditorServices.Host/EditorServicesHost.cs index 363eba04c..43ec42565 100644 --- a/src/PowerShellEditorServices.Host/EditorServicesHost.cs +++ b/src/PowerShellEditorServices.Host/EditorServicesHost.cs @@ -8,6 +8,7 @@ using Microsoft.PowerShell.EditorServices.Session; using Microsoft.PowerShell.EditorServices.Utility; using System; +using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Threading; @@ -33,6 +34,7 @@ public class EditorServicesHost private HostDetails hostDetails; private string bundledModulesPath; private DebugAdapter debugAdapter; + private HashSet featureFlags; private LanguageServer languageServer; #endregion @@ -60,13 +62,15 @@ public EditorServicesHost( HostDetails hostDetails, string bundledModulesPath, bool enableConsoleRepl, - bool waitForDebugger) + bool waitForDebugger, + string[] featureFlags) { Validate.IsNotNull(nameof(hostDetails), hostDetails); this.hostDetails = hostDetails; this.enableConsoleRepl = enableConsoleRepl; this.bundledModulesPath = bundledModulesPath; + this.featureFlags = new HashSet(featureFlags ?? new string[0]); #if DEBUG int waitsRemaining = 10;