PowerArgs.Cli.TabKeyHandler.Handle C# (CSharp) Method

Handle() public method

Handles the tab key by calling all registered tab completion handlers.
public Handle ( RichCommandLineContext context ) : void
context RichCommandLineContext Context that can be used to inspect the current command line to perform tab completion
return void
        public void Handle(RichCommandLineContext context)
        {
            context.Intercept = true;
            context.RefreshTokenInfo();
            try
            {
                foreach (var handler in TabCompletionHandlers)
                {
                    if (handler.TryTabComplete(context))
                    {
                        break;
                    }
                }
            }
            catch(Exception ex)
            {
                if (ThrowOnTabCompletionHandlerException)
                {
                    throw;
                }
                else
                {
                    PowerLogger.LogLine("Tab completion handler threw exception: " + ex.ToString());
                }
            }
        }