jonsequitur / dotnet-repl

A polyglot REPL built on .NET Interactive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when pressing <Tab> with nothing to auto-complete

themilkyninja opened this issue · comments

Steps to reproduce:

  1. Start dotnet-repl
  2. Press Tab key

Version: Latest (0.1.11)

Example:

PS C:\Users\me> dotnet repl
                      _   _   _____   _____     ____    _____   ____    _              ____     _  _
                     | \ | | | ____| |_   _|   |  _ \  | ____| |  _ \  | |      _     / ___|  _| || |_
                     |  \| | |  _|     | |     | |_) | |  _|   | |_) | | |     (_)   | |     |_  ..  _|
                  _  | |\  | | |___    | |     |  _ <  | |___  |  __/  | |___   _    | |___  |_      _|
                 (_) |_| \_| |_____|   |_|     |_| \_\ |_____| |_|     |_____| (_)    \____|   |_||_|

                                          .NET Interactive 💓 Spectre.Console

C# > Unhandled exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at dotnet_repl.LineEditorCommands.CompletionCommand.GetSuffixPosition(LineEditorContext context) in C:\dev\dotnet-repl\src\dotnet-repl\LineEditorCommands\CompletionCommand.cs:line 107
   at dotnet_repl.LineEditorCommands.CompletionCommand.Execute(LineEditorContext context) in C:\dev\dotnet-repl\src\dotnet-repl\LineEditorCommands\CompletionCommand.cs:line 31
   at RadLine.LineEditor.ReadLine(LineEditorState state, CancellationToken cancellationToken) in /_/src/RadLine/LineEditor.cs:line 174
   at RadLine.LineEditor.ReadLine(CancellationToken cancellationToken) in /_/src/RadLine/LineEditor.cs:line 63
   at dotnet_repl.Repl.RunAsync(NotebookDocument notebook, Boolean exitAfterRun) in C:\dev\dotnet-repl\src\dotnet-repl\Repl.cs:line 114
   at dotnet_repl.CommandLineParser.StartRepl(StartupOptions options, CancellationToken cancellationToken, IAnsiConsole ansiConsole) in C:\dev\dotnet-repl\src\dotnet-repl\CommandLineParser.cs:line 106
   at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
PS C:\Users\me>

I have the same issue.