public IEnumerable <CompletionResult> CompleteArgument(string commandName, string parameterName, string wordToComplete, CommandAst commandAst, IDictionary fakeBoundParameters)
            {
                var wc = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase);

                return(LearnedCompletionData.GetLearnedCompletions()
                       .Where(lcd => lcd.CommandName.Equals(_learnFromCommand ?? commandName, StringComparison.OrdinalIgnoreCase))
                       .Where(lcd => lcd.ParameterName.Equals(_learnFromParameter ?? parameterName, StringComparison.OrdinalIgnoreCase))
                       .SelectMany(lcd => lcd.Completions)
                       .Where(c => wc.IsMatch(c))
                       .Select(c => CreateCompletionResult(c))
                       );
            }
 protected override void Validate(object arguments, EngineIntrinsics engineIntrinsics)
 {
     if (arguments is object[] manyArgs)
     {
         foreach (var arg in manyArgs)
         {
             if (arg is null)
             {
                 continue;
             }
             LearnedCompletionData.LearnCompletion(Command, Parameter, arg.ToString());
         }
     }
     else
     {
         if (arguments is null)
         {
             return;
         }
         LearnedCompletionData.LearnCompletion(Command, Parameter, arguments.ToString());
     }
 }