diff --git a/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs b/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs index d149e2882e..8599f838b7 100644 --- a/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs +++ b/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs @@ -21,9 +21,7 @@ internal interface IExternalEnabledFeatures bool IsEnhancedComponentFunctionPropertyEnabled { get; } - bool IsComponentFunctionPropertyDataflowEnabled { get; } - - bool IsRemoveAllDelegationEnabled { get; } + bool IsComponentFunctionPropertyDataflowEnabled { get; } } internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures @@ -39,7 +37,5 @@ internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures public bool IsEnhancedComponentFunctionPropertyEnabled => true; public bool IsComponentFunctionPropertyDataflowEnabled => true; - - public bool IsRemoveAllDelegationEnabled => true; } } diff --git a/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs b/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs index abf908f462..7d7e92e3d7 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs @@ -82,6 +82,11 @@ public sealed class Features /// internal bool IsUserDefinedTypesEnabled { get; init; } = false; + /// + /// Enables RemoveAll delegation. + /// + internal bool IsRemoveAllDelegationEnabled { get; init; } + internal static readonly Features None = new Features(); /// @@ -124,6 +129,7 @@ internal Features(Features other) AsTypeLegacyCheck = other.AsTypeLegacyCheck; JsonFunctionAcceptsLazyTypes = other.JsonFunctionAcceptsLazyTypes; IsLookUpReductionDelegationEnabled = other.IsLookUpReductionDelegationEnabled; + IsRemoveAllDelegationEnabled = other.IsRemoveAllDelegationEnabled; } } } diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs index e4cc808eec..1a5a2b3458 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs @@ -509,7 +509,7 @@ public override bool IsServerDelegatable(CallNode callNode, TexlBinding binding) } // Use ECS flag as a guard. - if (binding.Document != null && !binding.Document.Properties.EnabledFeatures.IsRemoveAllDelegationEnabled) + if (!binding.Features.IsRemoveAllDelegationEnabled) { return false; }